473,395 Members | 1,975 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,395 software developers and data experts.

Dealing with command in GridView [asp.net 2.0]

8
Hello ;
I added grid view in my web project
and added buttun feild and covert it to template feild
and every thing works ok
protected void Grid1_Command(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
{
String z = (String)e.CommandArgument;

int indexGrid = Convert.ToInt16(z);




String CommandNamew = e.CommandName.ToString();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrin gs["colliersUAEConnectionString"].ConnectionString.ToString());

switch (CommandNamew)
{
//-------------------------------------------
case "CmdUp":
{

.....

.........


gridView1.DateBind();
}

the command excute and page post back to the browser and make change in database but on gridView dont appear data be same excpet u make refresh to the browser
...
I added gridView1.DateBind(); in the end of command above ^
and also tried to add page.Bind on page load event but nothing change

plz any sugestion
May 31 '07 #1
1 1093
gomzi
304 100+
Hello ;
I added grid view in my web project
and added buttun feild and covert it to template feild
and every thing works ok
protected void Grid1_Command(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
{
String z = (String)e.CommandArgument;

int indexGrid = Convert.ToInt16(z);




String CommandNamew = e.CommandName.ToString();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrin gs["colliersUAEConnectionString"].ConnectionString.ToString());

switch (CommandNamew)
{
//-------------------------------------------
case "CmdUp":
{

.....

.........


gridView1.DateBind();
}

the command excute and page post back to the browser and make change in database but on gridView dont appear data be same excpet u make refresh to the browser
...
I added gridView1.DateBind(); in the end of command above ^
and also tried to add page.Bind on page load event but nothing change

plz any sugestion

After performing the operations populate the gridview again with the data from the database before binding.
May 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: | last post by:
Hello, I am trying to get add a product to a cart from a gridview control when a button in the gridview is clicked. I have a book on how to do this in asp.net 2.0 but it is done by specifying...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
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...
3
by: Jeff | last post by:
Hey asp.net 2.0 In the source I posted below, there is a GridView (look at the bottom of the script): <asp:GridView ID="gvwOnline" runat="server"> </asp:GridView> I'm trying to assign a...
0
by: george | last post by:
Hi all - I am trying to use ASP.NET 2.0 to delete a row in an Oracle database table GC_LOG (see following, note that my connection string is fine, everything else like updateCommand is...
4
by: =?Utf-8?B?Y2hyaXM=?= | last post by:
I have a perent gridview which includes in a template field a child gridview. Child gridview includes command buttons for opening different windows based on its row selected. I used the code...
9
ihaveaquery
by: ihaveaquery | last post by:
Hi, Delete is working fine for me, but Update- Nothing is happening. Please find the code snippet below and help me out... <asp:GridView ID="empGrid" runat="server" AllowSorting="True"...
0
by: David Lozzi | last post by:
Howdy, I have a gridview with a linkbutton in a template column (code is below). When the linkbutton is clicked i want to display a little confirm right in the gridview to confirm deleting the...
3
by: myth0s | last post by:
Hello! In VB.NET I have a GridView that shows a list of dates and beside each date there's a delete button. For a reason I don't know, the delete event seems to be fired twice, but I have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.