or
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode && !(e.Item is GridEditFormInsertItem))
{
GridEditableItem item = e.Item as GridEditableItem;
GridEditManager manager = item.EditManager;
//Adding columns that are not editable
GridTextBoxColumnEditor editor = manager.GetColumnEditor("Description") as GridTextBoxColumnEditor;
editor.TextBoxControl.Enabled = false;
editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
editor = manager.GetColumnEditor("SameRegion") as GridTextBoxColumnEditor;
editor.TextBoxControl.Enabled = false;
editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
editor = manager.GetColumnEditor("AVRMName") as GridTextBoxColumnEditor;
editor.TextBoxControl.Enabled = false;
editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
editor = manager.GetColumnEditor("AVRMZName") as GridTextBoxColumnEditor;
editor.TextBoxControl.Enabled = false;
editor.TextBoxControl.BackColor = System.Drawing.Color.Gray;
editor.TextBoxControl.ForeColor = System.Drawing.Color.Black;
}
}
The description and SameRegion columns should have a dropdown in 'InsertMode' so that I can pass the selected values. How can I achieve this?
01.
<
telerik:RadGrid
ID
=
"ad"
runat
=
"server"
OnNeedDataSource
=
"ad_NeedDataSource"
AutoGenerateColumns
=
"false"
>
02.
<
MasterTableView
EditMode
=
"Batch"
CommandItemDisplay
=
"Top"
>
03.
<
BatchEditingSettings
EditType
=
"Row"
OpenEditingEvent
=
"Click"
/>
04.
<
Columns
>
05.
<
telerik:GridBoundColumn
DataField
=
"testProperty"
UniqueName
=
"testProperty"
HeaderText
=
"testProperty"
>
06.
</
telerik:GridBoundColumn
>
07.
<
telerik:GridBoundColumn
DataField
=
"test"
UniqueName
=
"test"
HeaderText
=
"test"
>
08.
</
telerik:GridBoundColumn
>
09.
<
telerik:GridBoundColumn
DataField
=
"description"
UniqueName
=
"description"
HeaderText
=
"description"
>
10.
</
telerik:GridBoundColumn
>
11.
<
telerik:GridBoundColumn
DataField
=
"code"
UniqueName
=
"code"
HeaderText
=
"code"
>
12.
</
telerik:GridBoundColumn
>
13.
<
telerik:GridTemplateColumn
HeaderStyle-Width
=
"300px"
HeaderText
=
"ShipCountry"
UniqueName
=
"ShipCountry"
14.
DataField
=
"ShipCountry"
>
15.
<
ItemTemplate
>
16.
<
asp:Label
ID
=
"lb"
runat
=
"server"
Text
=
"jklm"
></
asp:Label
>
17.
</
ItemTemplate
>
18.
<
EditItemTemplate
>
19.
<
telerik:RadComboBox
runat
=
"server"
Skin
=
"WebBlue"
ID
=
"RadComboBox1"
Height
=
"200px"
20.
Width
=
"270px"
DropDownWidth
=
"800px"
OnClientSelectedIndexChanged
=
"OnClientSelectedIndexChanged"
21.
ShowMoreResultsBox
=
"true"
EnableVirtualScrolling
=
"true"
ChangeTextOnKeyBoardNavigation
=
"true"
>
22.
<
Items
>
23.
<
telerik:RadComboBoxItem
Text
=
"gh1"
Value
=
"sdf1"
/>
24.
<
telerik:RadComboBoxItem
Text
=
"gh2"
Value
=
"sdf2"
/>
25.
<
telerik:RadComboBoxItem
Text
=
"gh3"
Value
=
"sdf34"
/>
26.
</
Items
>
27.
</
telerik:RadComboBox
>
28.
</
EditItemTemplate
>
29.
</
telerik:GridTemplateColumn
>
30.
</
Columns
>
31.
</
MasterTableView
>
32.
</
telerik:RadGrid
>
1.
<script type=
"text/javascript"
>
2.
function
OnClientSelectedIndexChanged(sender, args) {
3.
alert(
"fired!!!!!!!!!"
);
4.
}
5.
</script>
boundColumn.ClientTemplate(
"<input .... />"
);