troubleshooting Question

How can I display only part of data in the repeater control column?

Avatar of ASPNet_Developer
ASPNet_Developer asked on
ASP.NETVisual Basic.NETMicrosoft Development
4 Comments1 Solution399 ViewsLast Modified:
I have repeater control which I am binding directly to my datatable, to display data in column.
-----------------------------
ASPX page
----------------------------------
<asp:Repeater ID="Repeater1" runat="server">
      <HeaderTemplate>
      <table>
      <tr>
      <td>NAME</td>
      <td>DESCRIPTION</td>
      </tr>      
      </HeaderTemplate>
      <ItemTemplate>
      <tr>
      <td>
      <%# DataBinder.Eval(Container.DataItem, "NAME")%>
      </td>
      </tr>      
      <tr>
      <td>
      <%# DataBinder.Eval(Container.DataItem, "DESCRIPTION")%>
      </td>
      </tr>      
      </ItemTemplate>
      <AlternatingItemTemplate>
      <tr>
      <td>
      <%# DataBinder.Eval(Container.DataItem, "NAME")%>
      </td>
      </tr>      
      <tr>
      <td>
      <%# DataBinder.Eval(Container.DataItem, "DESCRIPTION")%>
      </td>
      </tr>      
      </AlternatingItemTemplate>
      <FooterTemplate>
      </table>
      </FooterTemplate>
      </asp:Repeater>
----------------------------------
ASPX.VB page
-------------------------------------
If ds.Tables(0).Rows.Count > 0 Then
      Repeater1.DataSource = ds
Repeater1.DataBind()
            End If
            myDS.Dispose()
----------------------------------------
In DESCRIPTION the data is really long. Ex:'1-1-1-this is example-123456-d-d.................'.
I do not want to display all of it.
Is there a way I can display only "this is example-123456" when I bind the column to the repeater?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros