We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl problem with column width

Thread ID:

Created:

Updated:

Platform:

Replies:

74834 Jun 30,2008 08:22 AM Dec 26,2008 08:36 AM ASP.NET Web Forms (Classic) 7
loading
Tags: GridGroupingControl
Kallyani Lanje
Asked On June 30, 2008 08:22 AM

Hi
I couldn't set column width in my GridGroupingControl. please provide the solution.

I have used as following code.
GridGroupingControl1.Table.TableDescriptor.Columns(0).Width = 300
GridGroupingControl1.Table.TableDescriptor.Columns(1).Width = 100

But it was not reflected on runtime.

Thank you




Rajarajeswari S [Syncfusion]
Replied On July 4, 2008 05:48 AM

Hi Kalyani,

Thanks for using Syncfusion products.

I am afraid that I am not able to reproduce the issue. Please refer the below code snippet to set column width.

this.GridGroupingControl1.TableDescriptor.Columns[1].Width = 300;

Please refer the below screen shot in which "Column2" has been set as 300:

http://www.syncfusion.com/support/user/uploads/colwidth_8cba4ef9.png

Please refer the sample from the below link which illustartes the above:


http://www.syncfusion.com/support/user/uploads/ColWidth_3258a3ce.zip


Please let me know if you have any other concerns.

Regards,
Raji


Rajarajeswari S [Syncfusion]
Replied On July 4, 2008 05:56 AM

Hi Kalyani,

Thanks for using Syncfusion products.

I am afraid that I am not able to reproduce the issue. Please refer the below code snippet to set column width.

this.GridGroupingControl1.TableDescriptor.Columns[1].Width = 300;

Please refer the below screen shot in which "Column2" has been set as 300:

http://www.syncfusion.com/support/user/uploads/colwidth_8cba4ef9.png

Please refer the sample from the below link which illustartes the above:


http://www.syncfusion.com/support/user/uploads/ColWidth_3258a3ce.zip


Please let me know if you have any other concerns.

Regards,
Raji


Saurabh Srivastava
Replied On December 13, 2008 06:47 AM


Hi,

I am also facing the same issue. Please help


Rajarajeswari S [Syncfusion]
Replied On December 15, 2008 01:24 AM

Hi Saurabh,

I am afraid that I am not able to reproduce the issue, that you have mentioned here. Applying Custom CSS doesn’t affect of setting column width. Please refer the below sample where I have followed the below things:

1. Created Grid, and applied custom CSS.
2. Creating a new column dynamically.
3. Setting width for the dynamically created column.
4. The width is applied to the column properly.

Please refer the below code snippet which illustrates this:

protected void Button1_Click(object sender, EventArgs e)
{
this.GridGroupingControl1.TableDescriptor.Columns.Add("NewColumn");
GridColumnDescriptor gcd = this.GridGroupingControl1.TableDescriptor.GetColumnDescriptor("NewColumn");
gcd.Width = 300;
}

Please refer the sample from the below link, which illustrates the above:

http://www.syncfusion.com/support/user/uploads/Sample_f8581c1.zip

Please let me know if you have any other concerns.

Regards,
Raji



Saurabh Srivastava
Replied On December 24, 2008 08:12 AM

Hi Raji,

I have tried to basically nail down the issue here. What I did was took your sample. Instead of generating the datacolumn and adding it to the datatable what I did was to just create a datatable and execute a stored procedure to fill in the datatable. Now assign that datatable to your grid and the grid column width setiings cannot be overriden. Can you please check this?



Saurabh Srivastava
Replied On December 24, 2008 08:14 AM

Hi,

This is the code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
private string connectionString = String.Empty;
private DataTable reservationRecords = new DataTable();

protected void Page_Load(object sender, EventArgs e)
{


connectionString = "xxxxx";

if (!IsPostBack)
{

SqlConnection connection = new SqlConnection(connectionString);
SqlCommand command = new SqlCommand();

command.Connection = connection;
command.CommandTimeout = 0;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "sp_SelectReservation";

SqlDataAdapter adapter = new SqlDataAdapter(command);
adapter.Fill(reservationRecords);
connection.Dispose();

GridGroupingControl1.DataSource = reservationRecords;


GridGroupingControl1.TableOptions.AllowHover = false;
GridGroupingControl1.TableOptions.AllowDragColumns = false;
GridGroupingControl1.TableOptions.ListBoxSelectionMode = Syncfusion.Web.UI.WebControls.Shared.SelectionMode.None;
GridGroupingControl1.TableOptions.AllowDropDownCell = false;
this.GridGroupingControl1.TableOptions.ShowRowHeader = false;

this.GridGroupingControl1.ChildGroupOptions.ShowCaptionPlusMinus = false;


}
this.GridGroupingControl1.TableDescriptor.Columns[5].Width = 300;
}
}



Rajarajeswari S [Syncfusion]
Replied On December 26, 2008 08:36 AM

Hi Saurabh,

Thanks for using Syncfusion products.

Regardless of the Database the Width properly will work properly with GridGroupingControl, But we have found some issue with WebPart applications.

With normal page models it is working fine that has been illustrate for you with the samples of previous updates.

If still you have found issue with normal Page models, could you please reproduce the issue with the above sample and send back to us? so that we could sort out the cause of the issue very soon and provide you a better solution.

Regards,
Raji





CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;