I have one combo box on my page .And I have assigned one data-table to it as Data source .
Now My data table has three columns , ID ,Short_ID,Title.And Data Text of my combo must be Short_ID.Title may contains any character and alpha numerical characters.
Now on Selected Index change event of Com-box , I want all three values.
IF I assign join ID and Title by any value and assign it to Data value field ,then it will create problem.
How can I solve This issue ?
-Thanks
narasimman gPosted Feb 7, 2011, 1:29 PM
if you dont want to join and split
why dont you place one more invisible dropdownlist
if you have three values say A,B,C fetch
dd1.DataTextField =A;
dd1.DataValueField = B;
//Invisible one
dd2.DataTextField =C
dd2.DataValueField = B;
dd1.selectedvalue = "UserAssignedValue" //from button click
dd2.selectedvalue = "UserAssignedValue";
So you wil get B and C from dd1 and dd2 resp in selectedValue;
this may be the temporary workaround Since u dont want to iterate
Suthish NairPosted Feb 7, 2011, 9:21 AM
if(value[0]==ID) { Li.Selected=true; break; }Roy rPosted Feb 7, 2011, 6:51 AM
Suthish NairPosted Feb 7, 2011, 5:59 AM
Can you explain this line more:
"Because each time when I want to select combo box item by "
Roy rPosted Feb 6, 2011, 11:43 PM
Suthish NairPosted Feb 5, 2011, 11:51 AM
Suthish NairPosted Feb 5, 2011, 3:23 AM
Now combobox binding
Now on Selected Index change, get the selected value and split on '-'.
ddl.SelectedValue.Split('~')[0]ddl.SelectedValue.Split('~')[1]