PC Review


Reply
Thread Tools Rate Thread

BoundField cells not visible during rowcommand ??

 
 
jobs
Guest
Posts: n/a
 
      9th Feb 2007
Can somebody tell me why Jobno and Value BoundFields are not available
during the command SaveParm ? i enter text into the box for Value and
hit the Save button, but all I see is the Parmvalue.



Thanks in advance for any help or information!!



<asp:GridView ID="ParmView" runat="server" SkinID="GridView"
AutoGenerateColumns="False"
DataSourceID="ParmDataSource" AllowSorting="True"
AllowPaging="True" Caption="Paramater Values"
CaptionAlign="Left">
<Columns>
<asp:ButtonField ButtonType="Image" ImageUrl="../
App_Themes/WinXP_Silver/Images/edit.gif" CommandName="EditParm" />
<asp:ButtonField ButtonType="Image" ImageUrl="../
App_Themes/WinXP_Silver/Images/save.gif" CommandName="SaveParm" />
<asp:BoundField DataField="Jobno" Visible="false" />
<asp:BoundField DataField="Parmname" ReadOnly="true"
HeaderText="Parameter" />
<asp:BoundField DataField="Value" ControlStyle-
Width="300px" HeaderText="Value" />
</Columns>
<RowStyle Wrap="False" />
</asp:GridView>


... code behind

Protected Sub RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
rungridview.RowCommand, ParmView.RowCommand
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
Dim row As GridViewRow = sender.Rows(index)

If e.CommandName = "SaveParm" Then
Response.Write(row.Cells(0).Text)
Response.Write(row.Cells(1).Text)
Response.Write(row.Cells(2).Text)
Response.Write(row.Cells(3).Text)
Response.Write(row.Cells(4).Text)
'Jobs.SaveParm(CInt(row.Cells(2).Text), row.Cells(3).Text,
row.Cells(4).Text)
'ParmView.Focus()
'response.Write(row.DataItem("Jobno"))
End If

End Sub

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      10th Feb 2007
Howdy,

Because buttonfield is rendered as
System.Web.UI.WebControls.DataControlLinkButton which is added to cell's
control collection, therefore for cells 0 and 1 you should use:
row.Cells(0).Controls(0).Text
row.Cells(1).Controls(0).Text

--
Milosz


"jobs" wrote:

> Can somebody tell me why Jobno and Value BoundFields are not available
> during the command SaveParm ? i enter text into the box for Value and
> hit the Save button, but all I see is the Parmvalue.
>
>
>
> Thanks in advance for any help or information!!
>
>
>
> <asp:GridView ID="ParmView" runat="server" SkinID="GridView"
> AutoGenerateColumns="False"
> DataSourceID="ParmDataSource" AllowSorting="True"
> AllowPaging="True" Caption="Paramater Values"
> CaptionAlign="Left">
> <Columns>
> <asp:ButtonField ButtonType="Image" ImageUrl="../
> App_Themes/WinXP_Silver/Images/edit.gif" CommandName="EditParm" />
> <asp:ButtonField ButtonType="Image" ImageUrl="../
> App_Themes/WinXP_Silver/Images/save.gif" CommandName="SaveParm" />
> <asp:BoundField DataField="Jobno" Visible="false" />
> <asp:BoundField DataField="Parmname" ReadOnly="true"
> HeaderText="Parameter" />
> <asp:BoundField DataField="Value" ControlStyle-
> Width="300px" HeaderText="Value" />
> </Columns>
> <RowStyle Wrap="False" />
> </asp:GridView>
>
>
> ... code behind
>
> Protected Sub RowCommand(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
> rungridview.RowCommand, ParmView.RowCommand
> Dim index As Integer = Convert.ToInt32(e.CommandArgument)
> Dim row As GridViewRow = sender.Rows(index)
>
> If e.CommandName = "SaveParm" Then
> Response.Write(row.Cells(0).Text)
> Response.Write(row.Cells(1).Text)
> Response.Write(row.Cells(2).Text)
> Response.Write(row.Cells(3).Text)
> Response.Write(row.Cells(4).Text)
> 'Jobs.SaveParm(CInt(row.Cells(2).Text), row.Cells(3).Text,
> row.Cells(4).Text)
> 'ParmView.Focus()
> 'response.Write(row.DataItem("Jobno"))
> End If
>
> End Sub
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Visible Cells and paste in another workbook visible cells only Abdul Microsoft Excel Programming 5 2nd Aug 2009 02:08 AM
determine Boundfield Value during rowcommand deletion sjsean Microsoft ASP .NET 0 7th Feb 2009 06:21 AM
RE: Copy Visible Cells in Sheet with Merged and Hidden Cells FSt1 Microsoft Excel Misc 1 2nd Oct 2008 12:51 AM
Filter, clearing visible cells in a range, but leaving hidden cells Jason Chapman Microsoft Excel Discussion 2 27th Jun 2008 02:15 PM
Help: Copying Visible Cells only to Visible cells! Jay Jayakumar Microsoft Excel Programming 0 9th Jul 2003 08:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 AM.