Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts

Wednesday, March 28, 2012

the column size of gridview

hi all:

the one of the column of gridview got multiple line data to be shown , so
how do i deal with it? what i am thinking about is using template field
instead of the boundfield. is that other solution out there?

Cheers

NickHi Nick,

You can solve this problem with the DataGridView.AutoSizeColumns() method,
with one of the values from the DataGridViewAutoSizeColumnCriteria
enumeration.
You can choose to size columns based on the width of header text, the
currently displayed rows, or all the rows in the table.

The following code snippet resize columns based on the width of the largest
piece of text in a header or one of the rows for this column.
DataGridView1.AutoSizeColumns( _
DataGridViewAutoSizeColumnCriteria.HeaderAndRows)

Please note that this method needs to be invoked after you bind the data or
it won't have any effect. You might also want to use it after user editing
(perhaps in response to an event like DataGridView.CellValueChanged).

Rather than widening columns to fit, you can change the row size. By
default, the text in a column will wrap over multiple lines.

If you use the DataGridView.AutoSizeRows() method, the row will be
heightened to fit the content.

Before you use this method, you might want to widen the column size,
particularly if you have a field that contains a large amount of text. For
example, the following code snippet quadruples the size of the Description
column, and then resizes
the rows to accommodate the content.

DataGridView.Columns("Description").Width *= 4
DataGridView.AutoSizeRows( _
DataGridViewAutoSizeRowsMode.HeaderAndColumnsAllRo ws)

Pls let me know whether this helps you
Thanks & Regards,
Sundar Narasimman

"Nick" wrote:

Quote:

Originally Posted by

hi all:
>
the one of the column of gridview got multiple line data to be shown , so
how do i deal with it? what i am thinking about is using template field
instead of the boundfield. is that other solution out there?
>
Cheers
>
Nick

Tuesday, March 13, 2012

The memory could not be "read".

Hi,

I'm currently working on an ASP.NET application. The application is connected to an Oracle database. I have multiple drop-down-list's that contains two list items ('Yes'/'No'). I have autopostback set to true. When the user selects either 'Yes' or 'No', I immediately write the users drop-down-list selection to the database. On my ASP.NET page, I have lots of these drop-down-lists for specific records. When I use these drop-down-lists slowly, everything works fine. When I start to make my selections more quickly, I receive the following error: 'The instruction at "0x7d50a0d0" referenced memory at "0x00000018". The memory could not be "read".

Any suggestions?

bump.

Possibly a problem with your browser install? I guess the page reloads when you change the first dropdown and is still reloading when you change the second - the browser should either ignore the change in the second dropdown or abort the first reload and do the second.

At a guess i'd say there's a problem with your browser - have you tried it in another browser (IE/Firefox?) or checking for updates?

Hope that helps, Adam


How many select boxes do you have? This sounds more like a problem with the client than it does with .NET.
I'm currently using the latest version of IE. The application is on a network and is occuring on everyone's machine (IE Browser). I don't want to have to make Firefox mandatory.
The amount of drop-down-lists vary depending on the users selection. It doesn't matter how many they chose, the error still occurs.

all help is appreciated.


Can you post some code?