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.
Syncfusion Feedback

Column selecting possible in GridDataControl?

Thread ID:

Created:

Updated:

Platform:

Replies:

98050 Jan 28,2011 11:43 AM UTC Mar 8,2011 01:16 PM UTC WPF 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 28, 2011 11:43 AM UTC

Hi there,

I'm evaluating the Controls and have a question for the GridDataControl. Is it possible to select Columns (like in Excel)? In the GridControl I can do so, but there I can not set a DataSource. My data are coming from an ObservableCollection and I don't want to group or sort them.

Greetings
Andreas


Rajasekar [Syncfusion]
Replied On February 3, 2011 02:01 PM UTC

Hi Andreas,

Thanks for choosing Syncfusion products.

Yes it is possible to select to columns in Grid Data Control by setting the property AllowSelection as Column and ListBoxSelectionMode as None.

You can prevent sorting and grouping by setting the property AllowGroup and AllowSort as false.

We have also prepared the sample for your reference, please find the sample in the following location,

Sample: < http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=ObservableCollection1472666354.zip >

Please let us know if you have any queries.

Thanks,
Rajasekar




Administrator [Syncfusion]
Replied On February 7, 2011 01:04 PM UTC

Thank you Rajasekar,

it works so long I do not create Columns from CodeBehind. If I do so, I cannot select any Column.
This is my Grid:



And this is, how I create the columns:

private void AddDataColumn(string uniqueName, bool insert = false)
{
GridDataVisibleColumn column = new GridDataVisibleColumn();
if (uniqueName != " ")
{
column.MappingName = uniqueName;
}
else
{
column.MappingName = "col1";
column.IsReadOnly = true;
}
column.HeaderText = uniqueName;//p;
column.AllowSort = false;
column.AllowGroup = false;

if (insert)
{
int index = gdcEntscheidungstabelle.VisibleColumns.Count - 1;
this.gdcEntscheidungstabelle.VisibleColumns.Insert(index, column);
}
else
{
gdcEntscheidungstabelle.VisibleColumns.Add(column);
}
}

Any suggestions?



Rajasekar [Syncfusion]
Replied On February 17, 2011 09:35 AM UTC

Hi Andreas,

Thanks for your update.

We have checked with your requirement and we have tested our sample by setting visible columns in code behind, but we are able to select the column in the grid. If you find any difficulties in the column selection, please revert us with modified sample and replication procedure.

Sample: < http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DataContext-347944224.zip >

Please let us know if you have any queries.

Thanks,
Rajasekar




Administrator [Syncfusion]
Replied On February 23, 2011 01:06 PM UTC

Hi Rajaseka,

you can use the code and the file I've posted in this thread (http://www.syncfusion.com/support/forums/grid-wpf/98363/Problem-with-GridDataControl-width). With this you have to able (so I think) to reproduce my problem.
At time I'm using the version 9.1, but with 8.4 it was the same problem.

Thanks,
Andreas


Rajasekar [Syncfusion]
Replied On March 8, 2011 01:16 PM UTC

Hi Andreas,

Sorry for the Inconvenience caused.

We have analyzed the reported issue with our sample; we are not able to reproduce the issue. Can you please check with the sample in the following location? If possible can you share your full sample with us, which would be much appreciable?

Note: We have prepared the simple view model application in which visible columns are generated at code behind, here we can able to do column selection.

Sample : < http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=ColumnSelection1649028586.zip >

Please let us know if you have any queries.

Thanks,
Rajasekar



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.

Warning Icon 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.Close Icon

;