Hi Experts,
We are using the licensed version of Telerik RadControls for ASP.NET AJAX for one of our ASP.NET project. We have some issues while using the telerik that we are unable to fix. Would really appreciate if you can provide us the fix.
Issue 1:
While using the RADGrid to render the values, we sometimes face a strange issue wherein the grid header gets extended out. When we debugged the issue through IEDeveloper, we found that “Padding-right:17px” gets added automatically. This issues frequently happens when we toggle between the ASP.NET tab control and the RADGrid with the issue is placed inside the tab control.
Snapshot of the grid with the IEDeveloper debug details (Image attached below)
Issue 2:
We have another issue in the RADGrid with inline editing. Whenever a row is in edit mode (in EditFormSetting), moving the scroll bar in the RADGrid becomes sluggish. I have noticed his happening while RADComboBox is placed in editform.
Issue 3:
Is there a way to set the current focus to a particular row in the RADGrid? The requirement is, when I go an inline edit and save we actually rebind the data every time in the server which causes the grid to be refreshed and the scroll bar position also gets reset to the first row. I want the scroll bar position to be retained as it was before edit.
Query:
Is it possible to dynamically Bind an Entity list to the Telerik Grid? We have this feature in the ASP.NET grid which we have used extensively. Now, after incorportaing the RADGrid, we are unable to bind with our Entity list.
Is it possible to have dynamic columns for the above said entity biding ? The columns in the grid are dynamic based on certain crieteria, It can sometimes have 3 columns or it can some times have 10.
<telerik:RadGrid ID="dbgGridName" runat="server" EnableEmbeddedSkins="false"
Skin="Vista" AutoGenerateColumns="false" AllowAutomaticUpdates="false" AllowAutomaticInserts="false"
Width="502px" AllowPaging="false" ShowHeader="true" AllowMultiRowEdit="false" OnItemDataBound="dbgAddIPUsageData_ItemDataBound" >
</telerik:RadGrid>
// Dynamic adding of columns to grid
arrayListColumns = GetSession("arrayListColumns") as ArrayList;
paramValues = (string[])arrayListColumns.ToArray(typeof(string));
for (int i = 1; i <= paramValues.Length; i++)
{
CustomBoundColumn col2 = new CustomBoundColumn();
col2.DataField = Convert.ToString(paramValues.GetValue(i - 1));
col2.HeaderText = getGridColumnHeadings(Convert.ToString(paramValues.GetValue(i - 1)));
col2.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
dbgGridName.MasterTableView.Columns.Add(col2);
}
The Entity is attached as a text file.
Code behind Binding :
List<SomeDataEntity> myEntityList = fetchDataListFromDB() ;
…
….
dbgGridName.DataSource = myEntityList;
dbgGridName.DataBind();
TIA,
Ravishankar
protected void Button1_Click(object sender, EventArgs e)
{
RadGrid1.DataSource = RunStoredProcSearch(
"SearchNameCity", SearchGrid.Text);
RadGrid1.DataBind();
}
public DataSet RunStoredProcSearch(string spName, string search)
{
SqlConnection conn = null;
SqlDataReader rdr = null;
try
{
// create and open a connection object
conn =
new
SqlConnection("Data Source=LDSERVER1\\SQLLD;Initial Catalog=AviarySQL;Integrated Security=True");
conn.Open();
// 1. create a command object identifying
// the stored procedure
SqlCommand cmd = new SqlCommand(
spName, conn);
// 2. set the command object so it knows
// to execute a stored procedure
cmd.CommandType =
CommandType.StoredProcedure;
// 3. add parameter to command, which
// will be passed to the stored procedure
cmd.Parameters.Add(
new SqlParameter("@pattern", search));
// execute the command
cmd.Connection.Open();
SqlDataReader reader = cmd.ExecuteReader();
return reader;
}
finally
{
if (conn != null)
{
conn.Close();
}
if (reader != null)
{
rdr.Close();
}
}
}