Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2004, 03:34 AM
Authorized User
 
Join Date: Oct 2004
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default hiding / unhiding columns in datagrid

Hi guys,
how do i trigger events when after enetering 1-5 from first col it will unhide 3 columns and if i enter beyond this it will hide 3 columns in datagrid
hope u understand it,
tnx in advanced

 
Old October 8th, 2004, 01:56 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi drachx,
               I guess what you think off is not a feasible solution because you said if the value is 1-5 you need to show 3 columns and if it is not that then you need to hide 3 columns, but think there are 3 records already with values 1-5 in the first column so you need to display the 3 columns, but if you add new record that contains say 6 you need to hide 3 columns but for the first 3 records where you had values 1-5 you won't be able to see the values in the three columns, because you need to hide the columns for new the new record.

So think of some other solution like having text box.

but if you want you can make the column as readonly by using the following code

dataGrid1.TableStyles[0].GridColumnStyles["Asd"].ReadOnly = true;





It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old October 10th, 2004, 09:33 PM
Authorized User
 
Join Date: Oct 2004
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi pradeep,
thats what i want

this is abt acctng system, actual scenario is first column indatagrid is combo box which hav a lookup , when it choose cash in bank it will unhide addtl 3 columns to enter addtl data and then for another row if its not cash in bank then the normal no. of colmns it wiil display, the user dont need to see the 3 columns unless he go back to row that contains cashin bank then it will show up again,they hav the program now written in vb6 but they dont hav the source code, as ive said before,
hope to hear u soon
thnx

 
Old October 11th, 2004, 01:23 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The grid they use only for entering the records is it? or they are using that for viewing the records also? If they are using for entering alone, then we can try something with grid But I am not sure how to do that?

Can we do the same in TextBox?



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old October 11th, 2004, 01:38 AM
Authorized User
 
Join Date: Oct 2004
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

both, its for entering data and viewing also when they need to edit their inputs, users normally have to inputs lots of data so they are keen in keyboards and not depending on mouse

 
Old October 11th, 2004, 01:56 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I am thinking is that hoe to implement both the functionalities with the same grid? Let me think and get back to you!



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old October 12th, 2004, 07:40 PM
Authorized User
 
Join Date: Oct 2004
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi guys, really need ur help in datagrid

we have existing program in vb6 with no source code , it is an accounting system, the user inputs lots of data in datagrid,
the first column have a combo box which has a lookup ( see my previous post) if it choose cash in bank it will unhide 3 colmns to enter addtl data, and for another row if its not cash in bank it will unhide 3 columns, this happens in their program written in vb6,

i have my combobox now in my first column, teh only problem is hiding and unhiding columns
tnx in advanced

 
Old October 15th, 2004, 12:38 AM
Authorized User
 
Join Date: Oct 2004
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi guys, really need ur help in datagrid

we have existing program in vb6 with no source code , it is an accounting system, the user inputs lots of data in datagrid,
the first column have a combo box which has a lookup ( see my previous post) if it choose cash in bank it will unhide 3 colmns to enter addtl data, and for another row if its not cash in bank it will unhide 3 columns, this happens in their program written in vb6,

i have my combobox now in my first column, teh only problem is hiding and unhiding columns
tnx in advanced


 
Old October 16th, 2004, 06:19 AM
Authorized User
 
Join Date: Jul 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aravwind Send a message via Yahoo to aravwind
Default

bind the grid first
Add bound columns
chk for the condition of the selected item of combo

Datagrid1.Columns(0).Visible=False/true

accordingly
 
Old October 18th, 2004, 02:37 AM
Authorized User
 
Join Date: Oct 2004
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Datagrid1.Columns(0).Visible=False/true

there is no columns property in datagrid







Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Listview Columns? jakeone Beginning VB 6 12 October 2nd, 2008 03:52 PM
Trouble hiding and unhiding columns in VBA jtmelb Excel VBA 0 February 14th, 2007 07:04 PM
Hiding Report Columns gupta_abhinav99 Crystal Reports 1 February 9th, 2007 04:38 AM
Hiding datagrid column give error annsary ASP.NET 1.0 and 1.1 Professional 5 April 7th, 2006 03:45 AM
Dynamically Hiding Columns r_ganesh76 Crystal Reports 1 September 23rd, 2004 11:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.