Hello:
I am using ultragrid with ultradropdown.
I have a scenario wherein I am select the user_ID for a row on the grid. This cell has a ultra-dropdown that shows details of the user. When the user selects, I am able to set the User_ID appropriately.
The dropdown lists all the users that are in the database. Some of them could be active and some could be inactive. I would like to validate to make sure that the selelected user is active.
Can someone tell me how I can access the value of the User_Status (This is one of the fields in the dataset bound to the Ultra-dropdown) for item chosen in the Ultra-dropdown?
Venki
Hello,
I am just checking about the progress of this issue. Let me know If you need any further assistance on this matter?
Thank you for using Infragistics Components.
Hello,
You could handle AfterCloseUp event of UltraDropDown and to get the active row of the dropdown, which will be the selected row from the customer, you could use code like:
((UltraDropDown)sender).ActiveRow.Cells[1].Value
I think that better way will be to filter your dropdown, so that it should display only the users which are active. You could do this if you handled InitializeLayout event of UltraDropDown and to add there code like:
e.Layout.Bands[0].ColumnFilters["IsActive"].FilterConditions.Add(FilterComparisionOperator.Equals, true);
Or another approach which you could use is to disable those rows of UltraDropDown which has “IsActive” cell value – false.So the customwe will be able to see those rows into dropdown, but wouldn’t be able to select them.. You could use code like:
ultraDropDown1.Rows.Where(row => row.Cells["IsActive"].Value.Equals(false)).ToList<UltraGridRow>().ForEach(
delegate(UltraGridRow row)
{
row.Activation = Activation.Disabled;
});
Please let me know if you have any further questions.