datagrid hardcoding...

Discussion in 'ASP .Net' started by Alen Smith, Jun 30, 2005.

  1. Alen Smith

    Alen Smith Guest

    strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text

    Currently I have hardcoded the first column as Cells(0) value, what is the
    syntax to read the column by name. Hard coding like this is causing big
    problem for maintenance.

    ..Net 1.1.

    Thanks,

    Smith
    Alen Smith, Jun 30, 2005
    #1
    1. Advertising

  2. Alen Smith

    Curt_C [MVP] Guest

    Alen Smith wrote:
    > strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text
    >
    > Currently I have hardcoded the first column as Cells(0) value, what is the
    > syntax to read the column by name. Hard coding like this is causing big
    > problem for maintenance.
    >
    > .Net 1.1.
    >
    > Thanks,
    >
    > Smith
    >
    >
    >
    >


    Add your value to your DS or View prior to binding it.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
    Curt_C [MVP], Jun 30, 2005
    #2
    1. Advertising

  3. Alen Smith

    Alen Smith Guest

    Curt,

    Thanks for the reply.

    DS, referring to dataset?

    Can you please elaborate on this>

    Thanks,

    Smith


    "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    news:uLg$...
    > Alen Smith wrote:
    > > strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text
    > >
    > > Currently I have hardcoded the first column as Cells(0) value, what is

    the
    > > syntax to read the column by name. Hard coding like this is causing big
    > > problem for maintenance.
    > >
    > > .Net 1.1.
    > >
    > > Thanks,
    > >
    > > Smith
    > >
    > >
    > >
    > >

    >
    > Add your value to your DS or View prior to binding it.
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    Alen Smith, Jun 30, 2005
    #3
  4. Alen Smith

    Curt_C [MVP] Guest

    Alen Smith wrote:
    > Curt,
    >
    > Thanks for the reply.
    >
    > DS, referring to dataset?
    >


    Yup... DataSet
    How is your DS getting populated? Look through the calls for a .Add()

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
    Curt_C [MVP], Jun 30, 2005
    #4
  5. Alen Smith

    Alen Smith Guest

    strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text

    I am reading from the datagrid first column for iRowCounter.
    I am missing some link here. Why you are referring to dataset here?
    Thanks,
    Smith


    "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    news:...
    > Alen Smith wrote:
    > > Curt,
    > >
    > > Thanks for the reply.
    > >
    > > DS, referring to dataset?
    > >

    >
    > Yup... DataSet
    > How is your DS getting populated? Look through the calls for a .Add()
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    Alen Smith, Jun 30, 2005
    #5
  6. Alen Smith

    Curt_C [MVP] Guest

    Alen Smith wrote:
    > strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text
    >
    > I am reading from the datagrid first column for iRowCounter.
    > I am missing some link here. Why you are referring to dataset here?
    > Thanks,
    > Smith
    >


    Because you are talking about ADDING to the datagrid causing problem I
    though, not READING from it...

    If the additional item is added properly then reading it wont be any big
    deal.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
    Curt_C [MVP], Jun 30, 2005
    #6
  7. Alen Smith

    Alen Smith Guest

    Sometimes the requirements are such that I need to add the column in-between
    the existing columns.

    If I add like that, I need to recode all the column indexes which are right
    side of the newly added column.

    What is the meaning of "If the additional item is added properly then
    reading it wont be any big deal." How to solve this situation? What is
    "properly"

    Thanks for replying all questions.

    Smith





    "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    news:...
    > Alen Smith wrote:
    > > strMyText = dgdMyGrid.Items(iRowCounter).Cells(0).Text
    > >
    > > I am reading from the datagrid first column for iRowCounter.
    > > I am missing some link here. Why you are referring to dataset here?
    > > Thanks,
    > > Smith
    > >

    >
    > Because you are talking about ADDING to the datagrid causing problem I
    > though, not READING from it...
    >
    > If the additional item is added properly then reading it wont be any big
    > deal.
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    Alen Smith, Jun 30, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gyruss
    Replies:
    6
    Views:
    4,096
    Kenneth P. Turvey
    Jun 20, 2005
  2. cgian31
    Replies:
    11
    Views:
    765
    Oliver Wong
    Oct 21, 2005
  3. cgian31
    Replies:
    1
    Views:
    387
  4. Kyler Laird
    Replies:
    0
    Views:
    314
    Kyler Laird
    Dec 27, 2003
  5. cgian31
    Replies:
    0
    Views:
    265
    cgian31
    Oct 20, 2005
Loading...

Share This Page