Hi Vignesh,
Query: Getting the columns from the grid
control , when we use datasoure and databind,
Query: how to get the
gird column from the syncfusion grid control
Based on your query
we suspect that you want to get the column details from code behind. You can
achieve this requirement by using below code example,
void dataBind()
{
EmployeesGrid2.DataSource = (DataTable)Session["SqlDataSource"];
EmployeesGrid2.DataBind();
var col =
EmployeesGrid2.Columns;
}
|
In the above code example, we have got
the column details from grid model.
Please referred to the attached sample.
Query: I need to make the column Read only
Based on your query,
we suggest you disable the editing for particular column.
Please refer to the
below code example,
<Columns>
<ej:Column Type="checkbox"
Width="50" />
<ej:Column Field="OrderID" IsPrimaryKey="true"/>
<ej:Column Field="EmployeeID" AllowEditing="false" />
|
Please refer to the below API
documentation,
https://help.syncfusion.com/api/js/ejgrid#members:columns-allowediting
If the above solution does not
meet your requirement, kindly share the below details which is helpful to
proceed further.
- Complete Grid code example
- Detailed explanation of
the requirement.
- Video demo / screenshot of
the requirement
- Confirm whether you want to get the column details from client-side
or code-behind.
- Data binding details (whether you are using local or remote data
binding)
Kindly get back to us for further
assistance.
Regards,
Pon selva
If this post is
helpful, please consider Accepting it as the solution so that other members can
locate it more quickly.
Attachment:
webform_f71d13b2.zip