Hello guys.
I have a GridDropDownColumn that is binded in needDataSource event. The GridDropDownColumn's properties is show below:
Using the column like this, I have no problem with my grid, and I have some like:
Grid correct
but, I can't take the "ID" of the item, and when in editmode, I can't set the current item correctly. If I change the ListValueField to the correct data field I have some like this:
Grid incorrect
my server code is below:
What it not work? I'm following this thread:
http://www.telerik.com/community/forums/aspnet-ajax/grid/binding-programmatically.aspx
Thanks in advance.
Regards.
I have a GridDropDownColumn that is binded in needDataSource event. The GridDropDownColumn's properties is show below:
<telerik:GridDropDownColumn DataField="A017_dsc_tip" HeaderText="Tipo" ListDataMember="T017_tipo_telefone" |
SortExpression="A017_dsc_tip" ListTextField="A017_dsc_tip" ListValueField="A017_dsc_tip" UniqueName="A017_dsc_tip"> |
</telerik:GridDropDownColumn> |
Using the column like this, I have no problem with my grid, and I have some like:
Grid correct
but, I can't take the "ID" of the item, and when in editmode, I can't set the current item correctly. If I change the ListValueField to the correct data field I have some like this:
Grid incorrect
my server code is below:
protected void gdvTelefone_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
GridEditableItem editedItem = e.Item as GridEditableItem; |
GridEditManager editMan = editedItem.EditManager; |
//Setando o dropdownlist dos tipos de telefone |
GridDropDownListColumnEditor A017_dsc_tip = editMan.GetColumnEditor("A017_dsc_tip") as GridDropDownListColumnEditor; |
string selectedValue = A017_dsc_tip.SelectedValue; |
ObjectQuery<T017_TIPO_TELEFONE> query = entities.T017_TIPO_TELEFONE; |
A017_dsc_tip.DataSource = query.AsQueryable(); |
A017_dsc_tip.DataTextField = "A017_dsc_tip"; |
A017_dsc_tip.DataValueField = "A017_cod_tip"; |
A017_dsc_tip.DataBind(); |
A017_dsc_tip.SelectedValue = selectedValue; |
} |
} |
What it not work? I'm following this thread:
http://www.telerik.com/community/forums/aspnet-ajax/grid/binding-programmatically.aspx
Thanks in advance.
Regards.