I am writing to ask how best column width can be set RadGrid Columns - either in C#, or .aspx;
Thanks in advance for any insight - best regards;
Thanks in advance for any insight - best regards;
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
AllowPaging
=
"True"
OnNeedDataSource
=
"RadGrid2_NeedDataSource"
AllowSorting
=
"true"
AllowFilteringByColumn
=
"true"
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
AllowMultiColumnSorting
=
"True"
>
</
MasterTableView
>
</
telerik:RadGrid
>
public
DataTable GetDataTable(
string
query)
{
String ConnString =
""
;
//ConnString = ConfigurationManager.ConnectionStrings["CapacityManagement"].ConnectionString;
ConnString = ConfigurationManager.ConnectionStrings[2].ConnectionString;
SqlConnection conn =
new
SqlConnection(ConnString);
SqlDataAdapter adapter =
new
SqlDataAdapter();
adapter.SelectCommand =
new
SqlCommand(query, conn);
DataTable myDataTable =
new
DataTable();
conn.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
conn.Close();
}
return
myDataTable;
}
protected
void
RadGrid2_NeedDataSource(
object
source, GridNeedDataSourceEventArgs e)
{
(source
as
RadGrid).DataSource = GetDataTable(
"SELECT Date, Location, EquipmentType, InstalledPorts, UsedPorts, ReservedPorts, AvailablePorts, Utilization, ThreeMonthUtil, TwelveMonthUtil From tblSAMPortsLocationSummary"
);
}