473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

GridView ... confusing behavior

Hello,

I created a GridView which DataSource is created a DataView created in
a function.
The DataView is created from a DataTable which is saved on a Session
Variable.

The DataView has 3 bound fields:
Name, Description and Visible

And 1 Button Field:
Remove

The DataView is created as follows:

dv = New DataView(dt, "Visible = True", "Name",
DataViewRowState.CurrentRows)

When I click a button on a row I define the Visible Field as False on
RowCommand event:

dt.Rows.Item(e.CommandArgument)("Visible") = False
dt.DataBind

I am able to change the Visible field a first time but after that I am
not able to do that anymore.

When I click a button I see that the index is right in the list that I
see in the GridView.
However, for that index I get the data not of the row that I am
looking but of the original row on that position before I click the
button and make one of the rows Visible to false.

I have not been able to figure what might be going on.

Could someone give me a tip where to look for?

I looked everywhere and I can't find the solution.

Thanks,
Miguel

Mar 9 '07 #1
1 1025
On 8 mar, 18:36, "shapper" <mdmo...@gmail.comwrote:
Hello,

I created a GridView which DataSource is created a DataView created in
a function.
The DataView is created from a DataTable which is saved on a Session
Variable.

The DataView has 3 bound fields:
Name, Description and Visible

And 1 Button Field:
Remove

The DataView is created as follows:

dv = New DataView(dt, "Visible = True", "Name",
DataViewRowState.CurrentRows)

When I click a button on a row I define the Visible Field as False on
RowCommand event:

dt.Rows.Item(e.CommandArgument)("Visible") = False
dt.DataBind

I am able to change the Visible field a first time but after that I am
not able to do that anymore.

When I click a button I see that the index is right in the list that I
see in the GridView.
However, for that index I get the data not of the row that I am
looking but of the original row on that position before I click the
button and make one of the rows Visible to false.

I have not been able to figure what might be going on.

Could someone give me a tip where to look for?

I looked everywhere and I can't find the solution.

Thanks,
Miguel

If you can post your code it would be more helpful...

Mar 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: J055 | last post by:
Hi I have a very simple configuration of the GridView with paging and sorting. When I do a postback the DataBinding event fires twice - in both the ProcessPostData and PreRender stages of the...
3
by: chelsea | last post by:
I am using a GridView control with a ButtonField and receiving 2 row command events for each click of the button. Is there a configuration switch that I can turn that will ensure I only receive...
5
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the...
5
by: Abhijeet Kumar | last post by:
Hi I am working with ASP.NET2.0, How can i freeze some of the columns of GridView Control. Thanks in Advance.
13
by: AG | last post by:
I have a gridview that I bind to a List(of Type) at runtime. Not using a datasource control. The gridview has a template column with an imagebutton whose commandname is set to 'Delete'. The...
2
by: Richard Carpenter | last post by:
I have a four-page tabcontrol with a gridview on each page. I have the primary key column of each gridview set to hidden (visible = false), but it still shows up on all but the first page. Anyone...
1
by: Cirene | last post by:
This is confusing... I have a gridview (gv1) with another gridview (gv2) inside of it. gv1 has a bunch of house listings and within each row is a group of related house pictures (gv2). I'm...
4
by: Peter | last post by:
I want to call a JavaScript on PageIndexChanged event, how do I do that? Thank You Peter
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.