Datagrid question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BrianDH

    #1

    Datagrid question

    Hi

    I have a datagrid that I populate with a web service dataset.
    All fields are sent to text.
    However, one field will not show its value.
    You can click on a row and see that info in the grid's dataset, but the
    column is empty.

    What I have found is if the text that is passed into this field is EX: "This
    is a test"
    You will see this in the column

    but

    if the text is EX: "<p>this is a test</p>"
    Nothing shows up in the column.

    Here is how I have this column formated.

    Dim txtBody As New DataGridTextBox Column
    txtBody.Mapping Name = "BodyText"
    txtBody.HeaderT ext = "Body"
    txtBody.Width = 100
    txtBody.ReadOnl y = True
    ts1.GridColumnS tyles.Add(txtBo dy)

    I know it has something to do with the text formating code, but i need that
    formating to be there.

    Thanks
    BrianDH
  • ng

    #2
    Re: Datagrid question

    Try embedding quotes around the phrase. But you'll have to remember to
    strip them when you need to work with that phrase.

    Tom

    BrianDH wrote:
    [color=blue]
    >Hi
    >
    >I have a datagrid that I populate with a web service dataset.
    >All fields are sent to text.
    >However, one field will not show its value.
    >You can click on a row and see that info in the grid's dataset, but the
    >column is empty.
    >
    >What I have found is if the text that is passed into this field is EX: "This
    >is a test"
    >You will see this in the column
    >
    >but
    >
    >if the text is EX: "<p>this is a test</p>"
    >Nothing shows up in the column.
    >
    >Here is how I have this column formated.
    >
    > Dim txtBody As New DataGridTextBox Column
    >txtBody.Mappin gName = "BodyText"
    >txtBody.Header Text = "Body"
    >txtBody.Widt h = 100
    >txtBody.ReadOn ly = True
    >ts1.GridColumn Styles.Add(txtB ody)
    >
    >I know it has something to do with the text formating code, but i need that
    >formating to be there.
    >
    >Thanks
    >BrianDH
    >
    >[/color]

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Datagrid question

      Brian,

      Mostly these errors are because of the mappingname of the column, which has
      by instance another casing (upper lower cases) or is different than you are
      giving now.

      I hope this helps,

      Cor


      Comment

      • BrianDH

        #4
        RE: Datagrid question

        OK the quotes are not the issue. i am not passing in quotes.
        what is at issue is the html tags.

        field/column name is not the issue becaues I get data in the column if it
        does NOT have any html tags with in it.

        if i pass >> This is a test << I see it in the column
        but if I pass >> <p>This is a test</p> the column is empty.

        "BrianDH" wrote:
        [color=blue]
        > Hi
        >
        > I have a datagrid that I populate with a web service dataset.
        > All fields are sent to text.
        > However, one field will not show its value.
        > You can click on a row and see that info in the grid's dataset, but the
        > column is empty.
        >
        > What I have found is if the text that is passed into this field is EX: "This
        > is a test"
        > You will see this in the column
        >
        > but
        >
        > if the text is EX: "<p>this is a test</p>"
        > Nothing shows up in the column.
        >
        > Here is how I have this column formated.
        >
        > Dim txtBody As New DataGridTextBox Column
        > txtBody.Mapping Name = "BodyText"
        > txtBody.HeaderT ext = "Body"
        > txtBody.Width = 100
        > txtBody.ReadOnl y = True
        > ts1.GridColumnS tyles.Add(txtBo dy)
        >
        > I know it has something to do with the text formating code, but i need that
        > formating to be there.
        >
        > Thanks
        > BrianDH[/color]

        Comment

        • ng

          #5
          Re: Datagrid question

          That's why I suggested embedding quotes, in other words,

          """"<p>This is a test</p>""""


          That way, what you'll end up seeing, if you don't strip the quotes when
          you pull the column from the table, is
          "<p>This is a test</p>"

          In order to use this column in a web page, you just have to replace the
          quotes with an empty string.

          Tom

          BrianDH wrote:
          [color=blue]
          >OK the quotes are not the issue. i am not passing in quotes.
          >what is at issue is the html tags.
          >
          >field/column name is not the issue becaues I get data in the column if it
          >does NOT have any html tags with in it.
          >
          >if i pass >> This is a test << I see it in the column
          >but if I pass >> <p>This is a test</p> the column is empty.
          >
          >"BrianDH" wrote:
          >
          >
          >[color=green]
          >>Hi
          >>
          >>I have a datagrid that I populate with a web service dataset.
          >>All fields are sent to text.
          >>However, one field will not show its value.
          >>You can click on a row and see that info in the grid's dataset, but the
          >>column is empty.
          >>
          >>What I have found is if the text that is passed into this field is EX: "This
          >>is a test"
          >>You will see this in the column
          >>
          >>but
          >>
          >>if the text is EX: "<p>this is a test</p>"
          >>Nothing shows up in the column.
          >>
          >>Here is how I have this column formated.
          >>
          >> Dim txtBody As New DataGridTextBox Column
          >>txtBody.Mappi ngName = "BodyText"
          >>txtBody.Heade rText = "Body"
          >>txtBody.Wid th = 100
          >>txtBody.ReadO nly = True
          >>ts1.GridColum nStyles.Add(txt Body)
          >>
          >>I know it has something to do with the text formating code, but i need that
          >>formating to be there.
          >>
          >>Thanks
          >>BrianDH
          >>
          >>[/color][/color]

          Comment

          Working...