Hi
i have ultragrid ,ultradropdown attached to the one column.if i selected some text from the dropdown iam getting valuemember value (ID) in afterupdate row event.if i did not select anything in dropdown list it is giving dispaly text in after row update event.
can u any one help on this
When the column's Style resolves to 'DropDown', as I believe is the case when youn assign a ComboBox-like editor, the cell's value will be the underlying data value when the text in the edit portion matches one, or the display text itself when that text does not match any items. You can change this by setting the Style property to 'DropDownList' or 'DropDownValidate'; the former prevents typing altogether and the latter restricts typed values to those that match an item in the dropdown list.
i set the column value to the dropdownlist or DropDownValidate.But not solved.Same text values which are filled from datatable not matched with dropdownlist values even though both are same.if i need id values from cell i have to select some text value from the dropdownlist attached to the cell then it shows selected value in blue color.by default when filled from datatable those are not matching with dropdown item values.Anu code added to match both values?
e.Layout.Bands[0].Columns[3].ValueList =
this.ultraDropDown1;
private
void BindUltraDropDown()
{
DataTable dt = new DataTable();
dt.Columns.Add(
"ID", typeof(int));
"DisplayText", typeof(string));
dt.Rows.Add(
new object[] { 0, "A" });
new object[] { 4, "B" });
new object[] { 5, "C" });
new object[] { 1, "A" });
new object[] { 2, "B" });
new object[] { 3, "C" });
dt.AcceptChanges();
this.ultraDropDown1.DataSource = dt;
this.ultraDropDown1.ValueMember = "ID";
this.ultraDropDown1.DisplayMember = "DisplayText";
}
private void BindGrid()
"Dropdo");
"dropdoqwn1");
new object[] { 1, "A", "A", "A" });
new object[] { 2, "B", "A", "A" });
new object[] { 3, "C", "A", "A" });
ultraGrid1.DataSource = dt;
ultraGrid1.DataBind();
i assigned style value to drodown list or dropdown validate
e.Layout.Bands(0).Columns(
).Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownValidate
below you can find some code which is getting row value in DRV object,In thet item array iam getting dropdownlist valuemember if i change some text in dropdown list.If i didnt changed anything in dropdown list it is giving text to drv .itemarry
ultragrdEditCompanies.AfterRowUpdate
If e.Row.Band Is Me.ultragrdEditCompanies.DisplayLayout.Bands(0)
Then
(e.Row.ListObject, DataRowView)