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. Image for the cookie policy date
close icon

Como faz para ocultar colunas no grid grouping control e depois buscar o valor dessa coluna oculta?

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


11 Replies

SN Sridhar N Syncfusion Team April 6, 2011 06:39 AM UTC


Hi Tomio,

Thanks for using Syncfusion products.

Query #1 "Hiding and fetching data from clientside"

Your requirement to get the value of hidden column can be achieve by hiding the Column in client side using HideColumn() method and get the data from the childNodes of CurrentRow.Please refer the below code snippet.

[Javascript]

Sys.Application.add_load(Pageload);
function Pageload()
{
var gridTable = GetEGridTable($get('<%= GridGroupingControl1.ClientID %>'));
// Hiding column in client side.
gridTable.HideColumn(2);
}
function ClientChange(Odata)
{
//Fetching the hidden column value.
var company = Odata.currentRow.tableRows[0].childNodes[3].innerHTML;
alert("Hidden column value" + company);
}


For your convenience, we have created sample and the same can be downloaded from the following link.

Forum 98859 - client-46502681.zip

Query #2 "Hiding and fetching data from server side"


Your requirement to get the value of hidden column can be achieve by hiding the Column in server side using VisibleColumns.Remove method and get the data using GetValue method.Please refer the below code snippet.

[Codebehind - C#]

protected void Page_Load(object sender, EventArgs e)
{
this.GridGroupingControl1.DataSourceControlRowUpdating += new GridDataSourceControlRowUpdateEventHandler(GridGroupingControl1_DataSourceControlRowUpdating);
this.GridGroupingControl1.SelectedRecordsChanged += new Syncfusion.Grouping.SelectedRecordsChangedEventHandler(GridGroupingControl1_SelectedRecordsChanged);
//Hiding the columns in server side
this.GridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Name");
}
void GridGroupingControl1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)
{
if (e.SelectedRecord != null)
{
//Fetching the hidden column values
string name = e.SelectedRecord.Record.GetValue("Name").ToString();
Textvalue.Text = name;
}
}
For your convenience, we have created sample and the same can be downloaded from the following link.

Forum 98859 - server103088920.zip

Please let me know if you have any other questions or concerns.

Regards,
Sridhar.N







TO Tomio April 6, 2011 02:33 PM UTC

Hi, but how I do it in VB.Net?



ES Eswari S Syncfusion Team April 7, 2011 06:49 AM UTC

Hi Tomio,

Thanks for your interest in Syncfusion products.

We have provided response to your query in forum 98897

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

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

Please let us know if you have any queries.

Regards,
Eswari.S




TO Tomio April 13, 2011 02:49 PM UTC

Hi How do I lock the grouping by two columns, if you have a column grouped and User wants another place "to put the outar the grid removes the column that was already in the group" in gridGroupingControl in VB.NET?
Thanks




SN Sridhar N Syncfusion Team April 14, 2011 06:30 AM UTC

Hi Tomio,

Thanks for the update.

We are sorry for inconvenience caused. Before we start providing the solution, Could you please give the clear description about your requirement since we are unable to understand your requirement exactly.The information provided would be of great help in providing solution.

Please let us know if any concerns.

Regards,
Sridhar N



TO Tomio April 14, 2011 03:10 PM UTC

hi, it follows as Annex I want.

Tank




What I want and I do not want_bb55918f.zip


TO Tomio April 14, 2011 03:13 PM UTC

hi, it follows as Annex I want.

Tank



What I want and I do not want_262c9780.zip


TO Tomio April 14, 2011 05:13 PM UTC

hi, it follows as Annex I want.

Tank




What_I_want_and_I_do_not_want_fab9693e.zip


RR Ranjithkumar R G Syncfusion Team April 18, 2011 05:18 PM UTC

Hi Tomio,

Thanks for using Syncfusion products.

Your requirement can be achieved by handling GroupedColumnsChanged event. Please refer to the code snippet below.

[CodeBehind-CS]



void GroupedColumns_Changed(object sender, ListPropertyChangedEventArgs e)
{
SortColumnDescriptor toRemove = new SortColumnDescriptor();
if (e.Action != ListPropertyChangedType.Remove)
{
foreach (var temp in this.ggc.TableDescriptor.GroupedColumns)
{
if (temp.Name != ((SortColumnDescriptor)e.Item).Name)
{
toRemove = temp;
}
}
this.ggc.TableDescriptor.GroupedColumns.Remove(toRemove);

}
}



Please refer to the below link to download the sample application.

sample-98855-513879950.zip

Please let me know if you have need further assistance.

Regards,
Ranjithkumar.




RA rajvardhanreddy April 24, 2015 12:48 PM UTC

hi sir,
how can hide column in syncfusion grid grouping control ,after hiding i need to fetch data from that particular column. 


AM Abdul Matin M Syncfusion Team April 27, 2015 12:44 PM UTC

Hi Raj,


Thanks for your interest in Syncfusion products.


We noticed that the query is same, which has been already addressed on Apr 6th, 2011 with sample and code snippet. So, please provide us with clear description about your requirement as we are unable to understand your requirement exactly. The information provided would be of great help in providing solution.


Please let us know if you need any further assistance.


Regards,

Abdul Matin M


Loader.
Live Chat Icon For mobile
Up arrow icon