Conditional Column template / Special rows fields

2 posts, 0 answers
  1. Craig
    Craig avatar
    14 posts
    Member since:
    Sep 2008

    Posted 24 Dec 2008 Link to this post

    I'm looking to create this affect (see html) with the rad grid, and I could use some advice or a tutorial. I'm using an object datasource. The objects are "products" and there is a property for "prodcut can be ordered by each" instead of case.  When the flag is true I'd like to add, a extra row showing the each price, and a new textbox and to the line entry so it's still kind of the same line. I don't want it to be a NEW row in the grid because of sorting. I hope that make some sense. Hopefully the sample will clarify.

    <table width="100%" border="0" cellspacing="1" cellpadding="1">
      <tr bgcolor="#999999">
        <td width="10%">Dist #</td>
        <td width="10%">Desc</td>
        <td width="10%">Price</td>
        <td width="10%">Uom</td>
        <td width="10%">Qty</td>
        <td width="10%">Par</td>
        <td width="10%">OH</td>
      <tr bgcolor="#FFFFFF">
          <input type="text" name="textfield14" id="textfield14" />
        <td><input type="text" name="textfield14" id="textfield15" /></td>
        <td><input type="text" name="textfield14" id="textfield16" /></td>
      <tr bgcolor="#CCCCCC">
        <td colspan="7">
         <table width="100%" cellpadding="0" cellspacing="0">
            <td width="10%">124</td>
        <td width="10%">Milk</td>
        <td width="10%">12.25</td>
        <td width="10%">cs</td>
        <td width="10%"><input type="text" name="textfield2" id="textfield2" /></td>
        <td width="10%"><input type="text" name="textfield8" id="textfield8" /></td>
        <td width="10%"><input type="text" name="textfield9" id="textfield9" /></td>
      <tr bgcolor="#CCCCCC">
        <td width="10%">124</td>
        <td width="10%">Milk</td>
        <td width="10%">4.39</td>
        <td width="10%">ea</td>
        <td width="10%"><input type="text" name="textfield3" id="textfield3" /></td>
        <td width="10%">&nbsp;</td>
        <td width="10%">&nbsp;</td>
        <td><input type="text" name="textfield14" id="textfield21" /></td>
        <td><input type="text" name="textfield14" id="textfield22" /></td>
        <td><input type="text" name="textfield14" id="textfield23" /></td>
      <tr bgcolor="#CCCCCC">
        <td><input type="text" name="textfield14" id="textfield24" /></td>
        <td><input type="text" name="textfield14" id="textfield25" /></td>
        <td><input type="text" name="textfield14" id="textfield26" /></td>
  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 28 Dec 2008 Link to this post

    Hi Craig,

    There is not any direct support for conditional formatting in the RadGrid. However, you can use the ItemDataBound event of the RadGrid to check item values and format them as needed. Here is a link to a tutorial on how to achieve this result. As for adding an additional row to the items which meet your condition, there is no real easy way to do this that I can think of.

    I hope this helps. If you have further questions, please let me know.

    Kevin Babcock
  3. DevCraft R3 2016 release webinar banner
Back to Top