My Grid has an UltraDropDown in it.
When a user selects a row in my grid, I need to capture the ValueMember for the already populated DisplayMember of the dropdown. How can I do this?
I am using the AfterRowActivate Event in my grid
Many thanksJason
WOOHOO.
Now that makes a lot more sense.
I altered the DataSource to retrieve the Int key instead of the string name, refreshed everything and now it works as expected.
Thanks Mike.
Hi Jason,
Jason McIntosh said:The Grid column itself is databound and has a datatype of String. The DropDownList in this column opens a list which has 2 columns. An Int for the TradeID and a String for the TradeName to display. I have set the properties for the DDL to be: DisplayMember - TradeNameValueMember - TradeID
The DropDownList in this column opens a list which has 2 columns. An Int for the TradeID and a String for the TradeName to display.
I have set the properties for the DDL to be:
DisplayMember - TradeNameValueMember - TradeID
Why is the grid column a string when it is storing Ints? that might be the problem and will almost certainly cause performance problems. The ValueMember column data type should always match up with the grid column data type.
I would have thought so too, but I am having a problem
The Grid column itself is databound and has a datatype of String.
The Grid has the ValueList set as the DDL.
All is good so far. The user sees the String rather than the Int, however the following line of code only returns the String:
this.grdTradeBreakdown.Rows[IntSelectedRow].Cells[1].Value;
I have also looked at:
this.grdTradeBreakdown.Rows[IntSelectedRow].Cells[1].Text;
This also only returns the String. I would have thought one of them was supposed to return the Int that was set in the DDL that this was selected from.
I need to deal with the Int value and nothing I have tried seems to be allowing me to do this.
Any ideas?
Thanks
It sounds like you should just be reading the Value of the cell in the grid. You don't need to involve the DropDown at all.