Hi all :)
when I make my RadGrid, I allow automatic insert items, and show it in the grid header, but it make no action in fact
here is my hole code
Here is only the code of Rad grid and my sqlDatasource
my C# code:
when I make my RadGrid, I allow automatic insert items, and show it in the grid header, but it make no action in fact
here is my hole code
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function rowDblClick(sender, eventArgs) {
sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManager1"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadWindowManager1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadInputManager1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"RadAjaxLoadingPanel1"
/>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
LoadingPanelID
=
"RadLoadingPanel1"
Height
=
"324px"
Width
=
"597px"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"SqlDataSource1"
ShowFooter
=
"True"
Skin
=
"Black"
Width
=
"682px"
PageSize
=
"1"
>
<
MasterTableView
DataKeyNames
=
"History_ID"
DataSourceID
=
"SqlDataSource1"
CommandItemDisplay
=
"Top"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"History_ID"
DataType
=
"System.Int32"
HeaderText
=
"History_ID"
ReadOnly
=
"True"
SortExpression
=
"History_ID"
UniqueName
=
"History_ID"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"User_ID"
DataType
=
"System.Int32"
HeaderText
=
"User_ID"
SortExpression
=
"User_ID"
UniqueName
=
"User_ID"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DiesesInformation"
HeaderText
=
"Disease Information"
SortExpression
=
"DiesesInformation"
UniqueName
=
"DiesesInformation"
>
</
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
/>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this product?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
/>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
PagerStyle
Mode
=
"Slider"
/>
<
ClientSettings
>
<
ClientEvents
OnRowDblClick
=
"rowDblClick"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
telerik:RadInputManager
runat
=
"server"
ID
=
"RadInputManager1"
Enabled
=
"true"
>
<
telerik:TextBoxSetting
BehaviorID
=
"TextBoxSetting1"
>
</
telerik:TextBoxSetting
>
<
telerik:NumericTextBoxSetting
BehaviorID
=
"NumericTextBoxSetting1"
Type
=
"Currency"
AllowRounding
=
"true"
DecimalDigits
=
"2"
>
</
telerik:NumericTextBoxSetting
>
<
telerik:NumericTextBoxSetting
BehaviorID
=
"NumericTextBoxSetting2"
Type
=
"Number"
AllowRounding
=
"true"
DecimalDigits
=
"0"
MinValue
=
"0"
>
</
telerik:NumericTextBoxSetting
>
</
telerik:RadInputManager
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
/>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
DeleteCommand
=
"DELETE FROM [Ddisease_History] WHERE [History_ID] = @History_ID"
InsertCommand
=
"INSERT INTO [Ddisease_History] ([User_ID], [DiesesInformation]) VALUES (@User_ID, @DiesesInformation)"
UpdateCommand
=
"UPDATE [Ddisease_History] SET [User_ID] = @User_ID, [DiesesInformation] = @DiesesInformation WHERE [History_ID] = @History_ID"
>
<
DeleteParameters
>
<
asp:Parameter
Name
=
"History_ID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"User_ID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"DiesesInformation"
Type
=
"String"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"User_ID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"DiesesInformation"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"History_ID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
</
telerik:RadAjaxPanel
>
</
div
>
Here is only the code of Rad grid and my sqlDatasource
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"SqlDataSource1"
ShowFooter
=
"True"
Skin
=
"Black"
Width
=
"682px"
PageSize
=
"1"
>
<
MasterTableView
DataKeyNames
=
"History_ID"
DataSourceID
=
"SqlDataSource1"
CommandItemDisplay
=
"Top"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"History_ID"
DataType
=
"System.Int32"
HeaderText
=
"History_ID"
ReadOnly
=
"True"
SortExpression
=
"History_ID"
UniqueName
=
"History_ID"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"User_ID"
DataType
=
"System.Int32"
HeaderText
=
"User_ID"
SortExpression
=
"User_ID"
UniqueName
=
"User_ID"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DiesesInformation"
HeaderText
=
"Disease Information"
SortExpression
=
"DiesesInformation"
UniqueName
=
"DiesesInformation"
>
</
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
/>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this product?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
/>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
PagerStyle
Mode
=
"Slider"
/>
<
ClientSettings
>
<
ClientEvents
OnRowDblClick
=
"rowDblClick"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
DeleteCommand
=
"DELETE FROM [Ddisease_History] WHERE [History_ID] = @History_ID"
InsertCommand
=
"INSERT INTO [Ddisease_History] ([User_ID], [DiesesInformation]) VALUES (@User_ID, @DiesesInformation)"
UpdateCommand
=
"UPDATE [Ddisease_History] SET [User_ID] = @User_ID, [DiesesInformation] = @DiesesInformation WHERE [History_ID] = @History_ID"
>
<
DeleteParameters
>
<
asp:Parameter
Name
=
"History_ID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"User_ID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"DiesesInformation"
Type
=
"String"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"User_ID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"DiesesInformation"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"History_ID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
my C# code:
using
System;
using
System.Collections;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Linq;
using
Telerik.Web.UI;
public
partial
class
R253H283HtlR1010L64_Lvu4evrR007e12_RwHaAnMza2832010_Pages_DeseaseHistory : System.Web.UI.UserControl
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
SqlDataSource1.ConnectionString = ConnectionString.connectionString();
SqlDataSource1.SelectCommand =
"SELECT [DiesesInformation], [History_ID], [User_ID] FROM [Ddisease_History] WHERE [User_ID]="
+ Session[
"UserInAdminPage"
].ToString();
}
}