Hello ,
i working with RadGrid but i have a problem could any one help me to resolve it .
i have RadGrid and i set it's data source with list of business objects
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Default2006" GridLines="None"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" Width="500px"
ShowStatusBar="True" OnPreRender="RadGrid1_PreRender" OnNeedDataSource="RadGrid1_NeedDataSource"
OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand"
OnDeleteCommand="RadGrid1_DeleteCommand" OnItemDataBound="RadGrid1_ItemDataBound">
<mastertableview gridlines="None" commanditemdisplay="Top" datakeynames="ACC_ID">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn HeaderText="NAME" UniqueName="NAME" DataField="Name">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn
DropDownControlType="DropDownList"
HeaderText="TYPE"
UniqueName="ACC_TYPE" DataField="CRM_ACC_TYPE"
ListTextField="NAME" ListValueField="TYPE_ID">
</telerik:GridDropDownColumn>
<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete"
CommandName="Delete" ConfirmDialogType="RadWindow" />
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</mastertableview>
<filtermenu skin="Vista" enabletheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</filtermenu>
</telerik:RadGrid>
CRM_ACC_TYPE is a property at data item and it is an object also conatin 2 property NAME and TYPE_ID
i faced problem at GridDropDownColumn when data grid bound i cann't see the Name of CRM_ACC_TYPE in the GridDropDownColumn in view mode it is empty.
and in edit mode i bound the GridDropDownColumn in RadGrid1_ItemDataBound Event some thing like that
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownColumnEditor editor = editMan.GetColumnEditor("ACC_TYPE") as GridDropDownColumnEditor;
editor.DataSource = enties.CRM_ACC_TYPE;
editor.DataTextField = "NAME";
editor.DataValueField = "TYPE_ID";
editor.DataBind();
}
}
i working with RadGrid but i have a problem could any one help me to resolve it .
i have RadGrid and i set it's data source with list of business objects
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Default2006" GridLines="None"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" Width="500px"
ShowStatusBar="True" OnPreRender="RadGrid1_PreRender" OnNeedDataSource="RadGrid1_NeedDataSource"
OnUpdateCommand="RadGrid1_UpdateCommand" OnInsertCommand="RadGrid1_InsertCommand"
OnDeleteCommand="RadGrid1_DeleteCommand" OnItemDataBound="RadGrid1_ItemDataBound">
<mastertableview gridlines="None" commanditemdisplay="Top" datakeynames="ACC_ID">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn HeaderText="NAME" UniqueName="NAME" DataField="Name">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn
DropDownControlType="DropDownList"
HeaderText="TYPE"
UniqueName="ACC_TYPE" DataField="CRM_ACC_TYPE"
ListTextField="NAME" ListValueField="TYPE_ID">
</telerik:GridDropDownColumn>
<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete"
CommandName="Delete" ConfirmDialogType="RadWindow" />
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</mastertableview>
<filtermenu skin="Vista" enabletheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</filtermenu>
</telerik:RadGrid>
CRM_ACC_TYPE is a property at data item and it is an object also conatin 2 property NAME and TYPE_ID
i faced problem at GridDropDownColumn when data grid bound i cann't see the Name of CRM_ACC_TYPE in the GridDropDownColumn in view mode it is empty.
and in edit mode i bound the GridDropDownColumn in RadGrid1_ItemDataBound Event some thing like that
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownColumnEditor editor = editMan.GetColumnEditor("ACC_TYPE") as GridDropDownColumnEditor;
editor.DataSource = enties.CRM_ACC_TYPE;
editor.DataTextField = "NAME";
editor.DataValueField = "TYPE_ID";
editor.DataBind();
}
}