Hi,
I am populating the radgrid by attaching a datasource where I have a dropdownlist in it. My code goes something like mentioned below.
the value of the designation for the datasource from database has something like L1, L2, L3........
So I want to set the dropdown for the designation of the employee .
Ex :
EmployeeID=1
EmployeeName="safar"
EmpDesignation="L2"
So the dropdown should set to Level2 for the employeeid 1 and so on. I assume it can be done in ItemBound.
<telerik:RadGrid ID="EmployeeGrid" runat="server"
AutoGenerateColumns="False" Width="455px"
onitemdatabound="EmployeeGrid_ItemDataBound" >
<ClientSettings AllowDragToGroup="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Selecting AllowRowSelect="True"></Selecting>
</ClientSettings>
<MasterTableView AllowFilteringByColumn="False">
<Columns>
<telerik:GridBoundColumn ReadOnly="true" ItemStyle-Width="150px" HeaderText="Employee Id"
DataField="EmployeeId"><ItemStyle Width="150px" ></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn ReadOnly="true" HeaderText="Employee Name"
DataField="EmployeeName" ItemStyle-Width="150px"><ItemStyle Width="150px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText ="Designation" Visible="true">
<ItemTemplate>
<asp:DropDownList ID="DesignationDropdownList" runat="server" >
<asp:ListItem Text="Level1" Value="1"/>
<asp:ListItem Text="Level2" Value="2"/>
<asp:ListItem Text="Level3" Value="3"/>
<asp:ListItem Text="Level4" Value="4"/>
</asp:DropDownList>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
I am populating the radgrid by attaching a datasource where I have a dropdownlist in it. My code goes something like mentioned below.
the value of the designation for the datasource from database has something like L1, L2, L3........
So I want to set the dropdown for the designation of the employee .
Ex :
EmployeeID=1
EmployeeName="safar"
EmpDesignation="L2"
So the dropdown should set to Level2 for the employeeid 1 and so on. I assume it can be done in ItemBound.
<telerik:RadGrid ID="EmployeeGrid" runat="server"
AutoGenerateColumns="False" Width="455px"
onitemdatabound="EmployeeGrid_ItemDataBound" >
<ClientSettings AllowDragToGroup="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Selecting AllowRowSelect="True"></Selecting>
</ClientSettings>
<MasterTableView AllowFilteringByColumn="False">
<Columns>
<telerik:GridBoundColumn ReadOnly="true" ItemStyle-Width="150px" HeaderText="Employee Id"
DataField="EmployeeId"><ItemStyle Width="150px" ></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn ReadOnly="true" HeaderText="Employee Name"
DataField="EmployeeName" ItemStyle-Width="150px"><ItemStyle Width="150px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText ="Designation" Visible="true">
<ItemTemplate>
<asp:DropDownList ID="DesignationDropdownList" runat="server" >
<asp:ListItem Text="Level1" Value="1"/>
<asp:ListItem Text="Level2" Value="2"/>
<asp:ListItem Text="Level3" Value="3"/>
<asp:ListItem Text="Level4" Value="4"/>
</asp:DropDownList>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>