Hi,
I want to restrict user to not to Edit Few Columns. Here I am sending the Example which I am trying to implement the above functionality.
<telerik:RadGrid ID="RadGrid1"
Width="97%" Skin="Office2007"
ShowStatusBar="True" AllowSorting="True" PageSize="7" GridLines="None" AllowPaging="True"
runat="server" AllowAutomaticUpdates="True"
AutoGenerateColumns="False"
OnDataBound="RadGrid1_DataBound" onneeddatasource="RadGrid1_NeedDataSource">
<PagerStyle Mode="NumericPages" />
<MasterTableView Width="100%" DataKeyNames="OrderID,ProductID" EditMode="InPlace" AutoGenerateColumns="false">
<Columns>
<telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID" ReadOnly="True" HeaderStyle-Width="20%" />
<telerik:GridBoundColumn UniqueName="ProductID" DataField="ProductID" HeaderText="ProductID" ReadOnly="True" HeaderStyle-Width="15%" />
<telerik:GridBoundColumn UniqueName="Quantity" DataField="Quantity" HeaderText="Quantity" HeaderStyle-Width="20%" />
<telerik:GridDropDownColumn UniqueName="CbxUnitPrice" HeaderText="Unit price"
ListTextField="UnitPrice" ListValueField="UnitPrice" DataField="UnitPrice" HeaderStyle-Width="25%" />
<telerik:GridBoundColumn UniqueName="Discount" DataField="Discount" HeaderText="Discount" HeaderStyle-Width="20%" />
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick"
OnGridCreated="GridCreated" />
</ClientSettings>
</telerik:RadGrid>
C#:
//Declare a global DataTable dtTable
public static DataTable dtTable;
//Declare a global SqlConnection SqlConnection
//public SqlConnection SqlConnection = new SqlConnection("Data Source=local;Initial Catalog=Northwind;User ID=**");
public static SqlConnection SqlConnection = new SqlConnection("server=.;database=Northwind;uid=sa;pwd=password");
//Declare a global SqlDataAdapter SqlDataAdapter
public SqlDataAdapter SqlDataAdapter = new SqlDataAdapter();
//Declare a global SqlCommand SqlCommand
public SqlCommand SqlCommand = new SqlCommand();
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
string StrCon = "SELECT TOP 18 * FROM OrdersDetails";
SqlDataAdapter dap = new SqlDataAdapter(StrCon, SqlConnection);
DataSet ds = new DataSet();
dap.Fill(ds, "OrdersDetails");
this.RadGrid1.DataSource = ds.Tables[0];
}
In the above Example I want restrict user to not to edit “Quantity” Column.
Please Guide me in this regards.