Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default datagrid help

    I have a datagrid which contains links. Once the user clicks on one
    of the link, it supposes to refresh the reform and saves the data in a
    hidden field. I don't know if it is possible. And also, once the user
    clicks on the link, can it run the csharp code in the codebehind?

    Thanks.
    powerranger Guest

  2. Similar Questions and Discussions

    1. How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event.
      How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the...
    2. UserControl inside of datagrid - loses its viewstate when datagrid is re-bound on postback
      I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of...
    3. custom usercontrol inside of datagrid - loses its state/viewstate on re-bind/postback of the datagrid
      I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of...
    4. problema ultima pagina datagrid asp.net/problem last page datagrid
      ciao, ho un problema. ho un datagrid in una pagina asp.net con le impostazioni di PAGING abilitate. Uso l'impostazione NUMERIC PAGE. Il problema è...
    5. To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
      Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to...
  3. #2

    Default Datagrid help

    Hello all,

    I need help with this. I have a datagrid (dg1) with checkboxes and I want
    when some rows are selected to populate another datagrid (dg2) with the
    selected rows from (dg1).

    Thanks

    Momo


    momo Guest

  4. #3

    Default DataGrid Help

    I am using Provider=MSIDXS.1 and following code to fill datagrid.


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim strCatalog As String

    ' Catalog Name

    strCatalog = "TestCatalog"

    Dim strQuery As String

    If TextBox1.Text <> "" Then

    DataGrid1.Visible = True

    strQuery = "Select DocTitle,Filename,Size,PATH,URL from SCOPE() where FREETEXT('" & TextBox1.Text & "')"

    Dim connString As String = "Provider=MSIDXS.1;Integrated Security ..='';Data Source='" & strCatalog & "'"

    Dim cn As New System.Data.OleDb.OleDbConnection(connString)

    Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)

    Dim testDataSet As New DataSet()

    cmd.Fill(testDataSet)



    Dim source As New DataView(testDataSet.Tables(0))

    DataGrid1.DataSource = source

    DataGrid1.DataBind()

    Else

    DataGrid1.Visible = False

    End If

    End Sub

    End Class



    The result I am getting in datagrid is in plain text

    How do I make datagrid to show url in clickable format?
    Or how can I make datagrid item in hyperlink format?
    VLAD Guest

  5. #4

    Default Datagrid help

    I am using Provider=MSIDXS.1 and following code to fill datagrid.


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles Button1.Click

    Dim strCatalog As String

    ' Catalog Name

    strCatalog = "TestCatalog"

    Dim strQuery As String

    If TextBox1.Text <> "" Then

    DataGrid1.Visible = True

    strQuery = "Select DocTitle,Filename,Size,PATH,URL from SCOPE() where
    FREETEXT('" & TextBox1.Text & "')"

    Dim connString As String = "Provider=MSIDXS.1;Integrated Security .='';Data
    Source='" & strCatalog & "'"

    Dim cn As New System.Data.OleDb.OleDbConnection(connString)

    Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)

    Dim testDataSet As New DataSet()

    cmd.Fill(testDataSet)



    Dim source As New DataView(testDataSet.Tables(0))

    DataGrid1.DataSource = source

    DataGrid1.DataBind()

    Else

    DataGrid1.Visible = False

    End If

    End Sub

    End Class



    The result I am getting in datagrid is in plain text

    How do I make datagrid to show url in clickable format?
    Or how can I make datagrid item in hyperlink format?
    Thanks in adv.


    VLAD Guest

  6. #5

    Default Re: DataGrid Help

    search this newsgroup for today. i've posted code to add a hyperlink.

    --
    Regards,
    Alvin Bruney
    Got tidbits? Get it here...
    [url]http://tinyurl.com/2bz4t[/url]
    "VLAD" <VLADP@camba.org> wrote in message news:%23f0$2QI1DHA.1924@TK2MSFTNGP10.phx.gbl...
    I am using Provider=MSIDXS.1 and following code to fill datagrid.


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim strCatalog As String

    ' Catalog Name

    strCatalog = "TestCatalog"

    Dim strQuery As String

    If TextBox1.Text <> "" Then

    DataGrid1.Visible = True

    strQuery = "Select DocTitle,Filename,Size,PATH,URL from SCOPE() where FREETEXT('" & TextBox1.Text & "')"

    Dim connString As String = "Provider=MSIDXS.1;Integrated Security ..='';Data Source='" & strCatalog & "'"

    Dim cn As New System.Data.OleDb.OleDbConnection(connString)

    Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)

    Dim testDataSet As New DataSet()

    cmd.Fill(testDataSet)



    Dim source As New DataView(testDataSet.Tables(0))

    DataGrid1.DataSource = source

    DataGrid1.DataBind()

    Else

    DataGrid1.Visible = False

    End If

    End Sub

    End Class



    The result I am getting in datagrid is in plain text

    How do I make datagrid to show url in clickable format?
    Or how can I make datagrid item in hyperlink format?
    Alvin Bruney Guest

  7. #6

    Default Re: DataGrid Help

    Alvin,

    "Alvin Bruney" <vapor at steaming post office> wrote in message
    news:OpHg%23$J1DHA.1272@TK2MSFTNGP12.phx.gbl...
    search this newsgroup for today. i've posted code to add a hyperlink.

    Please repost it. I must have missed it. I am in the ADO.NET ng.


    scorpion53061 Guest

  8. #7

    Default Re: DataGrid Help

    itemcreated or itemdatabound event handler

    if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)

    {

    //column 1 is an itemtemplate column

    Label lbl = (Label)e.Item.FindControl("Dig");

    if(lbl != null)

    lbl.Text = "<input type=radio name='samegroup' value=" +
    e.Item.Cells[1].Text + ">";

    }


    --
    Regards,
    Alvin Bruney
    Got tidbits? Get it here...
    [url]http://tinyurl.com/2bz4t[/url]
    "scorpion53061" <Its the end of the world as we know [email]it@here.com[/email]> wrote in
    message news:OCkrcCK1DHA.1740@TK2MSFTNGP12.phx.gbl...
    > Alvin,
    >
    > "Alvin Bruney" <vapor at steaming post office> wrote in message
    > news:OpHg%23$J1DHA.1272@TK2MSFTNGP12.phx.gbl...
    > search this newsgroup for today. i've posted code to add a hyperlink.
    >
    > Please repost it. I must have missed it. I am in the ADO.NET ng.
    >
    >

    Alvin Bruney Guest

  9. #8

    Default datagrid help

    I need to allow the user to double click on a row within the grid and when
    that happens I need to get detailed information on that row and display this
    informatin below the grid on the same page.

    example:

    header1 header2 header3
    -----------------------------------------------------
    2 scooby 555-1212 -- when
    this is double clicked the following needs to appear.

    ---------footer---------------------------------

    Information on Scooby;

    Name: textbox
    Address: textbox
    Phone: textbox

    and this information can be updateable. Is there any examples online showing
    this in C#?



    Mike Guest

  10. #9

    Default Re: datagrid help

    Hi Mike,

    It sounds a bit like a hierarchical grid. In that case, you might want to
    look here:

    [url]http://www.denisbauer.com/ASPNETControls/HierarGrid.aspx[/url]

    "Mike" <anonymous@discussions.microsoft.com> wrote in message
    news:e3kG10bQEHA.3348@TK2MSFTNGP09.phx.gbl...
    >I need to allow the user to double click on a row within the grid and when
    > that happens I need to get detailed information on that row and display
    > this
    > informatin below the grid on the same page.
    >
    > example:
    >
    > header1 header2 header3
    > -----------------------------------------------------
    > 2 scooby 555-1212 -- when
    > this is double clicked the following needs to appear.
    >
    > ---------footer---------------------------------
    >
    > Information on Scooby;
    >
    > Name: textbox
    > Address: textbox
    > Phone: textbox
    >
    > and this information can be updateable. Is there any examples online
    > showing
    > this in C#?
    >
    >
    >
    Ken Cox [Microsoft MVP] Guest

  11. #10

    Default datagrid help

    on my web app, i need to have a input box to allow the user to set the
    number
    of rows they see in the grid,, Now i'm going against oracle so how can i do
    that?

    example:
    when the page loads I pull all rows back, but if the user only wants to see
    10 or 5 I can I make that change to the grid and only show 10 or 5?


    Mike Guest

  12. #11

    Default Re: datagrid help

    You can set the PageSize property if you are using paging. Is that what you
    meant?

    If so, take the input from the user and use that to set the number of rows
    per page.

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclasspagesizeto pic.asp[/url]

    "Mike" <me@me.com> wrote in message
    news:OHlpG99gEHA.3944@tk2msftngp13.phx.gbl...
    > on my web app, i need to have a input box to allow the user to set the
    > number
    > of rows they see in the grid,, Now i'm going against oracle so how can i
    > do
    > that?
    >
    > example:
    > when the page loads I pull all rows back, but if the user only wants to
    > see
    > 10 or 5 I can I make that change to the grid and only show 10 or 5?
    >
    >
    Ken Cox [Microsoft MVP] Guest

  13. #12

    Default DataGrid Help

    What exactly is a DataGrid?

    John


    John McClamrock Guest

  14. #13

    Default Re: DataGrid Help

    Hi John,

    It is an ASP.NET server-side control that renders in the browser as an HTML
    table full of data. Click the button here and you'll see a datagrid rendered
    as HTML:

    [url]http://www.dotnetjunkies.com/quickstart/aspplus/samples/webforms/intro/VB/Intro8.aspx[/url]


    "John McClamrock" <ehbryan@hotmail.com> wrote in message
    news:eP0ls9jCFHA.2380@tk2msftngp13.phx.gbl...
    > What exactly is a DataGrid?
    >
    > John
    >
    Ken Cox [Microsoft MVP] Guest

  15. #14

    Default Re: DataGrid Help

    Is there a way to show the ASP.NET VB Source for it so I can study it?

    --

    John


    John McClamrock Guest

  16. #15

    Default Re: DataGrid Help

    Sure!

    [url]http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/intro/Intro8.src[/url]

    [url]http://www.asp.net/Tutorials/quickstart.aspx[/url]


    "John McClamrock" <ehbryan@hotmail.com> wrote in message
    news:uMa7sElCFHA.4004@tk2msftngp13.phx.gbl...
    > Is there a way to show the ASP.NET VB Source for it so I can study it?
    >
    > --
    >
    > John
    >
    Ken Cox [Microsoft MVP] Guest

  17. #16

    Default Re: Datagrid help

    Hi
    I do have a similar thing working but I dont use the buttons, I use an edit
    column, like this . . . .

    <asp:DataGrid id="MyDataGrid"
    Autogeneratecolumns=false
    OnCancelCommand="Grid1_cancel"
    OnEditCommand="Grid1_edit"
    OnUpdateCommand="Grid1_update"
    DataKeyField="Associationid"

    Runat="Server">
    <columns>

    <asp:EditCommandColumn
    edittext="Edit"
    Canceltext = "Cancel"
    UpdateText = "OK"
    HeaderText="Click To Edit"
    />

    cheers
    ajm

    ajm4961 Guest

  18. #17

    Default datagrid help

    hi: I'm using a datagrid populated from a php file through loadvars, this
    datagrid is a list of news and the columns are: -date -title -I also have the
    newsID, but i dont want to show this one, I just want it for sending the
    parameter on click. so far this works, the thing is that when the user clicks
    on one row I want to send the newsID -using load vars- and show the news detail
    returned by loadvars in some text fields I have on stage. this is the first
    time I use the data grid so I'm kinda stuk in here, I don't know how to
    interact with the rows the user clicks on or what actions to use. the behavior
    I expect is when an user clicks a row, the row call the loadVars.load method
    sending the newsID from the clicked row as a parameter. got it? any comments
    will be welcome. thanx

    shaggydagy Guest

  19. #18

    Default Re: datagrid help

    I have done something similar. What I did was use the dataGrid's onChange
    event to trigger the update of the text field values. Something like this:
    gridHandler = new Object(); gridHandler.change = function(event) { // this is
    the stuff you want to have happen. // the following line is gathering the
    record from the grids dataprovider, you can reference that
    gridName.dataprovider instead of //a recordSet. I do not know exactly how you
    have things laid out. Also, the type of textfield (InputText,textarea, dynamic
    TextBox may require you to assign the field value to a different property.
    textField.text = recordSetName.getItemat(gridName.selectedIndex).fi eldName; }
    gridName.addEventListener('change',gridHandler); I assume you are using MX2004
    pro. I do not know if it matters. My capitalization is probably not correct
    for some of the methods or properties. Good luck DAN

    thedanster Guest

  20. #19

    Default Re: datagrid help

    I have to adpt some things but thanx for your comment it really helped. Now I'm on my way, thanx again.
    shaggydagy Guest

  21. #20

    Default datagrid help


    i don't know what I changed in my datagrid, it can't trigger
    the item_command event now, pls help.



    --
    dollar
    ------------------------------------------------------------------------
    Posted via [url]http://www.codecomments.com[/url]
    ------------------------------------------------------------------------

    dollar Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139