Hi, I am just starting using Telerik. So, first of all sorry if I make basic questions. I have been trough video, tutorial and documentation but I am not coming right.
I have a RadGrid with 5 fields. When I click on "add new record", the grid open-up but only 3 of the 5 fields are shown.
The two fields not showing are:
- the CustomerID, which is an auto-increase identity. I do not need this field to show up because I expect the database to manage it, so this is not the problem;
-the other one is the CustomerName, which is the primary key of the table, this is important to be shown and filled in.
I do not understand why these two fields do not show, however, how can I make the CustomerName showing up?
Moreover, when I click on "Insert", nothing happen. Is this related to the fact that there are missing fields in the table? Or do I need additional code to post the new records to the database?
Here is the RadGrid code:
Some help will be appreciated. Thanks.
I have a RadGrid with 5 fields. When I click on "add new record", the grid open-up but only 3 of the 5 fields are shown.
The two fields not showing are:
- the CustomerID, which is an auto-increase identity. I do not need this field to show up because I expect the database to manage it, so this is not the problem;
-the other one is the CustomerName, which is the primary key of the table, this is important to be shown and filled in.
I do not understand why these two fields do not show, however, how can I make the CustomerName showing up?
Moreover, when I click on "Insert", nothing happen. Is this related to the fact that there are missing fields in the table? Or do I need additional code to post the new records to the database?
Here is the RadGrid code:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
CellSpacing
=
"0"
Culture
=
"it-IT"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"TopAndBottom"
DataKeyNames
=
"CustomerName"
DataSourceID
=
"SqlDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"CustomerID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter CustomerID column"
HeaderText
=
"CustomerID"
ReadOnly
=
"True"
SortExpression
=
"CustomerID"
UniqueName
=
"CustomerID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CustomerName"
FilterControlAltText
=
"Filter CustomerName column"
HeaderText
=
"CustomerName"
ReadOnly
=
"True"
SortExpression
=
"CustomerName"
UniqueName
=
"CustomerName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CustomerContact"
FilterControlAltText
=
"Filter CustomerContact column"
HeaderText
=
"CustomerContact"
SortExpression
=
"CustomerContact"
UniqueName
=
"CustomerContact"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Country"
FilterControlAltText
=
"Filter Country column"
HeaderText
=
"Country"
SortExpression
=
"Country"
UniqueName
=
"Country"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"date"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter date column"
HeaderText
=
"date"
SortExpression
=
"date"
UniqueName
=
"date"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
</
telerik:RadGrid
>