Click here to Skip to main content
15,888,297 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: update the value depends on TIME Pin
nkmkrishna4-May-09 23:50
nkmkrishna4-May-09 23:50 
GeneralRe: update the value depends on TIME Pin
Nishant Singh4-May-09 23:53
Nishant Singh4-May-09 23:53 
GeneralRe: update the value depends on TIME Pin
nkmkrishna5-May-09 0:17
nkmkrishna5-May-09 0:17 
AnswerRe: update the value depends on TIME Pin
mdazeemuddin5-May-09 0:29
mdazeemuddin5-May-09 0:29 
AnswerRe: update the value depends on TIME Pin
Paddy Boyd5-May-09 2:24
Paddy Boyd5-May-09 2:24 
QuestionGridView row dissappearing on SelectedIndexChanged Pin
binarymax4-May-09 23:09
binarymax4-May-09 23:09 
AnswerRe: GridView row dissappearing on SelectedIndexChanged Pin
Christian Graus4-May-09 23:14
protectorChristian Graus4-May-09 23:14 
GeneralRe: GridView row dissappearing on SelectedIndexChanged Pin
binarymax4-May-09 23:25
binarymax4-May-09 23:25 
Right, it might help if I show the code!


<asp:GridView ID="gvIncidents" runat="server" AllowSorting="true" AutoGenerateColumns="false" onrowcommand="gvIncidents_RowCommand">
<HeaderStyle ForeColor="#606060"></HeaderStyle>
<Columns>
    <asp:BoundField DataField="FormID" HeaderText="" />
    <asp:BoundField DataField="FormType" HeaderText="Type" />
    <asp:BoundField DataField="FormDateTime" HeaderText="Date/Time" />
    <asp:BoundField DataField="Description" HeaderText="Description" />
    <asp:BoundField DataField="DateCreated" HeaderText="Date Created" />
    <asp:ButtonField CommandName="Import" Text="Import" ButtonType="Button" />
    <asp:ButtonField CommandName="Deny" Text="Delete" ButtonType="Button" />
</Columns>
</asp:GridView>


In my page load:
...
Me.gvIncidents.DataSource = dtIncidents
Me.gvIncidents.DataBind()
Me.gvIncidents.Visible = True
Me.gvIncidents.Columns(0).Visible = False
...


Handlers:
Protected Sub gvIncidents_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvIncidents.RowDataBound

    Try

        With e.Row
            If .RowType = DataControlRowType.DataRow Then

                .CssClass = "gridrow"

                'Change the cursor on mouseover
                .Cells(2).Attributes.Add("onMouseOver", "this.style.cursor='hand';")
                .Cells(2).Attributes.Add("onclick", ClientScript.GetPostBackEventReference(gvIncidents, "Select$" + .RowIndex.ToString()))

            Else 'Header
                .CssClass = "gridtitle"

            End If
        End With

    Catch ex As Exception
        Throw ex
    End Try

End Sub

Protected Sub gvIncidents_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvIncidents.SelectedIndexChanged
    Dim oGrid As GridView
    Dim oRow As GridViewRow

    Try
        oGrid = CType(sender, GridView)
        oRow = oGrid.SelectedRow

        PopulateIncidents() 'temporary hack to stop the rows from dissappearing

        ShowIncidentDetails(CType(oRow.Cells(0).Text, Integer))

    Catch ex As Exception

    End Try
End Sub

GeneralRe: GridView row dissappearing on SelectedIndexChanged Pin
Christian Graus4-May-09 23:27
protectorChristian Graus4-May-09 23:27 
GeneralRe: GridView row dissappearing on SelectedIndexChanged [modified] Pin
binarymax4-May-09 23:42
binarymax4-May-09 23:42 
GeneralRe: GridView row dissappearing on SelectedIndexChanged Pin
Herman<T>.Instance5-May-09 0:17
Herman<T>.Instance5-May-09 0:17 
GeneralRe: GridView row dissappearing on SelectedIndexChanged Pin
binarymax5-May-09 0:35
binarymax5-May-09 0:35 
GeneralRe: GridView row dissappearing on SelectedIndexChanged Pin
Herman<T>.Instance5-May-09 4:07
Herman<T>.Instance5-May-09 4:07 
GeneralRe: GridView row dissappearing on SelectedIndexChanged Pin
binarymax5-May-09 5:52
binarymax5-May-09 5:52 
QuestionView State Problem Pin
ybla824-May-09 22:28
ybla824-May-09 22:28 
AnswerRe: View State Problem Pin
Christian Graus4-May-09 22:44
protectorChristian Graus4-May-09 22:44 
GeneralRe: View State Problem Pin
ybla824-May-09 22:49
ybla824-May-09 22:49 
GeneralRe: View State Problem Pin
Christian Graus4-May-09 23:03
protectorChristian Graus4-May-09 23:03 
GeneralRe: View State Problem Pin
ybla824-May-09 23:11
ybla824-May-09 23:11 
GeneralRe: View State Problem Pin
Christian Graus4-May-09 23:12
protectorChristian Graus4-May-09 23:12 
GeneralRe: View State Problem Pin
ybla824-May-09 23:30
ybla824-May-09 23:30 
Questionhow to change tab event Pin
cspriya4-May-09 21:18
cspriya4-May-09 21:18 
AnswerRe: how to change tab event Pin
Christian Graus4-May-09 21:54
protectorChristian Graus4-May-09 21:54 
Questioninsert multiple row using single form Pin
prateekfgiet4-May-09 21:10
prateekfgiet4-May-09 21:10 
AnswerRe: insert multiple row using single form Pin
Christian Graus4-May-09 21:13
protectorChristian Graus4-May-09 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.