How to clear certain rows of a wxGrid? like 1 to 4 Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
hou
Knows some wx things
Knows some wx things
Posts: 34
Joined: Wed Apr 16, 2008 3:14 am

How to clear certain rows of a wxGrid? like 1 to 4

Post by hou » Tue Jul 22, 2008 3:16 am

Tks for answer.

How to clear certain rows of a grid. not use cleargrid() to clear the whole rows. why I want to do this, is I want to add title in the 0 row,like "name","gender"..."", I don't want to clear the 0 row title.

Another question:
The default title A,B,C....when use a wxGrid, can I get rid of them, including the fixed column title 1,2,3... can I change them?

I wish I can get the source of wxGrid and change it go well. :)
My brother is going to go to university.

timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post by timg » Tue Jul 22, 2008 6:41 am

You can use wxGrid::SetColLabelValue(int col, const wxString& value) and wxGrid::SetRowLabelValue(int row, const wxString& value) to change the column and row labels, assuming you are using the plain old wxGrid.

Maybe this is enough for you? If you put the column names in the label values, you could use wxGrid::ClearGrid() as is.

hou
Knows some wx things
Knows some wx things
Posts: 34
Joined: Wed Apr 16, 2008 3:14 am

Post by hou » Tue Jul 22, 2008 7:18 am

hi Timg, Tks a lot!

At first I didn't got the function in the manual, but it has and works fine. Can you email me a updated manual? hehe, just joking, my email:[email protected].

Tks always.
My brother is going to go to university.

Post Reply