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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamically Adding column and Hide/Show for column in Grid Control

Thread ID:

Created:

Updated:

Platform:

Replies:

45833 Jun 29,2006 07:05 AM UTC Apr 15,2011 02:49 PM UTC ASP.NET Web Forms (Classic) 8
loading
Tags: GridGroupingControl
manoj singh
Asked On June 29, 2006 07:05 AM UTC

Hi, I would like to know how can i dynamically add column and hide show column to Grid Grouping control and how can i set the datasource and bind it to Grid Grouping control. Along with this i would like to know how can i add hyperlink column to grid control Thanks & Regards, Manoj Singh.

Administrator [Syncfusion]
Replied On June 29, 2006 06:41 PM UTC

Hi Manoj, Here are my suggestions/answers for your queries. Biding Grid to DataSource: -------------------------- Have a look at our Setting up Data Binding section in our ''UsersGuide'' which you can find here : EssentialGrid->ASp.net->IntroducingEssentialGroupingGrid->UsingGridGroupingControl Also look in to the Tutorial in our ''UsersGuide'' Lesson1:"Essential Grid DataBinding". You can see that binding our grid is very similar like in normal ASP.NET grid control with minor changes. Adding a Column dynamically to the grid : ---------------------------------------- You can initialize a unboundColumn and can make use of it to add columns dynamically by using the following code [vb] Me.GridGroupingControl1.TableDescriptor.UnboundFields.Add("UnBoundColumn") Me.GridGroupingControl1.TableDescriptor.Columns.Add("UnBoundColumn") Me.GridGroupingControl1.TableDescriptor.VisibleColumns.Add("UnBoundColumn") you can fill this column either by handling the ''QueryValue'' event or ''QueryCellStyleInfo'' event. Showing/Hiding Columns: ----------------------- As mentioned in our UsersGuide section under EssentialGrid->Asp.Net->BasicConcepts Showing/Hiding Columns can be acheived as follows. The VisibleColumns collection of the TableDescriptor is auto-populated from the Columns collection and all the columns in that collection are automatically added to the VisibleColumns collection. Clicking on the VisibleColumns property of the Grid''s TableDescriptor launches the GridVisibleColumnDescriptor Collection Editor, where the column names of the columns that need to be displayed can be added or removed. to do this in code. [vb] Me.GridGroupingControl1.TableDescriptor.VisibleColumns.Remove("ColumnName") Adding a Hyperlink column to grid control: ------------------------------------------ It''s possible to add a hyperlink column as like in normal ASP.NET grid control using Item Template. please have a look at our Formatting/Portfolio sample that ships with our Essentialgrid Install which uses Hyperlink column as templates. Also please look in to this KB which explains this in detail. Hope the above suggestions should help you a good start with our grid. Let us know if you have any more queries Best Regards, A.Sivakumar.

Administrator [Syncfusion]
Replied On June 30, 2006 01:12 AM UTC

Hi Manoj, We have attached a sample with the following specifications: a) The grid is binded to the ''products'' table in the ''Nwind'' DataBase that ships with our ''Essential Grid'' install and points to the ''Syncfusion''virtual directory. b) An Unbound column ''Total'' is added dynamically and we fill this column calculating the ''total price'' for the ''existing stocks'' by handling the ''''QueryValue'''' event. c) You can show/hide the ''SupplierID'' column by clicking the button placed below the grid. d) The Hyperlink is added as a Item template for the ProductID column. By clicking the hyperlink column it goes to the appropriate '' Grid forums'' page Note:if you are not using 4.2.0.37 version you will have to change the Version numbers appropriately in the register tags. Thanks, Suresh

Forum45833.zip

manoj singh
Replied On June 30, 2006 06:33 AM UTC

Hi Siva / Suresh , Thanks for your help, i would like to know do we have anything in like "OnItemDataBound" event with Syncfusion grid control as we have in ASP.NET grid control so that we can changes the grid value while they are populating. On similer line to this, do we have anything like "<%#DataBinder.Eval(Container.DataItem, "ReportName")%>" Function which will help me in displaying datavalue directly in my ItemTemplate Column. Thanks again for your help. Regards, Manoj Singh.

Administrator [Syncfusion]
Replied On June 30, 2006 09:41 PM UTC

Hi Manoj, You can handle the ''QueryCellStyleInfo'' event to change any value of any cell in our grid based on your conditions. You can check for the record rows inside this and can change the value. To display the datavalue directly in your ItemTemplate Column can be done by using the "Container.StyleInfo.Text" in the aspx .Please have a look at our Templates/CustomTemplatedAppearance sample that ships with our ''EssentialGrid'' install which illustrates this. Alternatively you can also see this sample in our Essential Studio 4.2 Online Demo: Regards, A.Sivakumar

Tomio
Replied On April 5, 2011 02:05 PM UTC

Hi, I'd like to hide a column in the Grouping Grid Control, but I will need the values contained in this column.
How do I hide and then fetch the value of hidden column?
Thanks


Ranjithkumar R G [Syncfusion]
Replied On April 6, 2011 10:54 AM UTC

Hi Tomio,

Thanks for your interest in Syncfusion products.

We have provided response to your query in forum 98855

Could you please refer the below link for your query and follow up in the below forum.

http://www.syncfusion.com/support/forums/general/98855

Please let us know your concerns.

Regards,
Ranjithkumar.



Tomio
Replied On April 13, 2011 03:02 PM UTC

Hi, I wanted to know how to tell if the line is grouped in una normal when checked in GridGroupingControl in VB.NET? Thanks



Ranjithkumar R G [Syncfusion]
Replied On April 15, 2011 02:49 PM UTC

Hi Tomio,

Thanks for using Syncfusion products.

We have provided response to your query in forum 98989

Could you please refer the below link for your query and follow up in the below forum.

http://www.syncfusion.com/support/forums/general/98989

Please let us know your concerns.

Regards,
Ranjithkumar.


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

;