or
We are facing difficulties in implementing above combination of functionalities for Grid control. Your reply and any hot fix will be really useful and highly appreciatable. Looking for your response.
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowFilteringByColumn
=
"True"
AllowMultiRowSelection
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"LinqDataSource1"
GridLines
=
"None"
ondatabound
=
"RadGrid1_DataBound"
onitemdatabound
=
"RadGrid1_ItemDataBound"
onitemdeleted
=
"RadGrid1_ItemDeleted"
oniteminserted
=
"RadGrid1_ItemInserted"
onitemupdated
=
"RadGrid1_ItemUpdated"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"Top"
DataSourceID
=
"LinqDataSource1"
DataKeyNames
=
"Id"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
></
CommandItemSettings
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"Id"
HeaderText
=
"Gruppe"
SortExpression
=
"Id"
UniqueName
=
"Id"
AutoPostBackOnFilter
=
"True"
ShowFilterIcon
=
"false"
>
<
FooterTemplate
>Template footer</
FooterTemplate
><
FooterStyle
VerticalAlign
=
"Middle"
HorizontalAlign
=
"Center"
/>
<
ItemTemplate
><%#DataBinder.Eval(Container.DataItem, "Id")%></
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
DataTextField
=
"Id"
DataValueField
=
"Id"
ID
=
"RadComboBox1"
HighlightTemplatedItems
=
"true"
EmptyMessage
=
"Velg et element..."
AllowCustomText
=
"true"
runat
=
"server"
Height
=
"100px"
Width
=
"95px"
SelectedValue='<%#Bind("Id") %>' AutoPostBack="true" EnableAutomaticLoadOnDemand="True"></
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridNumericColumn
DataField
=
"FEE"
DataType
=
"System.Double"
HeaderText
=
"Avgift"
SortExpression
=
"FEE"
UniqueName
=
"FEE"
>
</
telerik:GridNumericColumn
>
<
telerik:GridNumericColumn
DataField
=
"PBE"
DataType
=
"System.Double"
HeaderText
=
"PBE"
SortExpression
=
"PBE"
UniqueName
=
"PBE"
>
</
telerik:GridNumericColumn
>
<
telerik:GridEditCommandColumn
CancelText
=
"Avbryt"
EditText
=
"Endre"
InsertText
=
"Sett inn"
UpdateText
=
"Oppdater"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Slett"
UniqueName
=
"column1"
>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:LinqDataSource
ID
=
"LinqDataSource2"
runat
=
"server"
OnInserting
=
"GridDataSource_Inserting"
ContextTypeName
=
"Mobitech.Mtbs2InfoEasy.linq.Mtbs2InfoEasy_DataClassesDataContext"
TableName
=
"Groups"
OrderBy
=
"Id"
Select
=
"new (Id, FEE, PBE)"
>
</
asp:LinqDataSource
>
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item.OwnerTableView.IsItemInserted && e.Item
is
GridDataInsertItem)
{
FillComboBoxWithClassCodes(e,
"RadComboBox1"
);
SetColumnWidthInInsertMode(e);
}
else
if
(!(e.Item
is
GridDataInsertItem) && e.Item.IsInEditMode)
{
FillComboBoxWithClassCodes(e,
"RadComboBox1"
);
SetColumnWidthInEditMode(e);
SetFocusOnField(e,
"PBE"
);
}
}
private
void
FillComboBoxWithClassCodes(GridItemEventArgs e,
string
comboBoxName)
{
var editItem = (GridDataItem) e.Item;
if
(editItem ==
null
)
return
;
var comboBox = (RadComboBox) editItem.FindControl(comboBoxName);
comboBox.Items.Clear();
foreach
(var classCode
in
classCodes)
{
var item =
new
RadComboBoxItem();
item.Text = classCode;
item.Value = classCode;
comboBox.Items.Add(item);
}
comboBox.DataBind();
}
How the senario is possible with RadAjaxpanel
Bellow is a code sample
<
asp:UpdatePanel
ID
=
"updatePanelSearch"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text
=
"Search"
></
asp:Label
>
<
telerik:RadTextBox
ID
=
"radtxtSearch"
runat
=
"server"
>
</
telerik:RadTextBox
>
<
asp:ImageButton
ID
=
"imgbtnSearch"
runat
=
"server"
ImageUrl
=
"~/Images/Search.png"
OnClick
=
"imgbtnSearch_Click"
/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
<
asp:UpdatePanel
ID
=
"updatePanelGrid"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
asp:PlaceHolder
ID
=
"phGrid"
runat
=
"server"
></
asp:PlaceHolder
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
protected
void
imgbtnSearch_Click(
object
sender, ImageClickEventArgs e)
{
updatePanelGrid.Update();
/*Update Grid*/
..........
/**/
}