[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

datagrid fixed column

Posted on 2007-10-08
11
Medium Priority
?
360 Views
Last Modified: 2013-11-18
hi,

how can i resize and hide (or remove) fixed column of a datagrid in my c# ppc application.

thanks.
0
Comment
Question by:janavar
  • 6
  • 5
11 Comments
 
LVL 7

Expert Comment

by:bungHoc
ID: 20032949
Don't have a running C# here so can't give you tested code. But you can hide column by simple set colum's width to 0:

private DataGridColumnStyle dgcStyle;
dgcStyle.Width = 0;

OR use methods DataGridColumnCollection.Remove and DataGridColumnCollection.RemoveAt

Hope this helps.
0
 

Author Comment

by:janavar
ID: 20033909
i do not mean user defined columns i mean default datagrid first column.
0
 

Author Comment

by:janavar
ID: 20034056
i mean rowheader
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Accepted Solution

by:
bungHoc earned 500 total points
ID: 20034482
As far as I know, row header doesn't display anything, it just gives some space to the left of the row to show the selected row or if a row is being edited. Is that what you want to remove/hide?

If so try this: this.somethingDataGrid.RowHeadersVisible = false;

or even more funny approach:

Subclass DataGrid, override OnPaint method
0
 

Author Comment

by:janavar
ID: 20037287
>>If so try this: this.somethingDataGrid.RowHeadersVisible = false;
yes, that works tohide but how can i resize it?

thanks...
0
 
LVL 7

Expert Comment

by:bungHoc
ID: 20039413
Try this: SomethingDataGrid.RowHeaderWidth = 0
0
 

Author Comment

by:janavar
ID: 20039726
i am developing at compact frame work for pocket pc and datagrid object does not have "RowHeaderWidth" property.
0
 
LVL 7

Expert Comment

by:bungHoc
ID: 20039771
Don't get it, why do you need to resize it if you already hid it?
0
 

Author Comment

by:janavar
ID: 20101034
sometimes it is needed ;)
0
 
LVL 7

Expert Comment

by:bungHoc
ID: 20101293
     // Create DataGridTableStyle used for table
      DataGridTableStyle tabStyle = new DataGridTableStyle();
     
      tabStyle.RowHeaderWidth = 30;
0
 

Author Comment

by:janavar
ID: 20214316
thank.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question