This is a migrated thread and some comments may be shown as answers.

Conditional Column template / Special rows fields

1 Answer 104 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 24 Dec 2008, 03:15 PM

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>
  <tr bgcolor="#FFFFFF">
    <td>123</td>
    <td>Cheese</td>
    <td>1.25</td>
    <td>cs</td>
    <td><label>
      <input type="text" name="textfield14" id="textfield14" />
    </label></td>
    <td><input type="text" name="textfield14" id="textfield15" /></td>
    <td><input type="text" name="textfield14" id="textfield16" /></td>
  </tr>
  <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>
  <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>
        </table>
    </td>
  </tr>
  <tr>
    <td>129</td>
    <td>Egg</td>
    <td>3.69</td>
    <td>cs</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>
  <tr bgcolor="#CCCCCC">
    <td>130</td>
    <td>Buttur</td>
    <td>3.12</td>
    <td>cs</td>
    <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>
  </tr>
</table>

1 Answer, 1 is accepted

Sort by
0
Kevin Babcock
Top achievements
Rank 1
answered on 28 Dec 2008, 01:05 PM
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.

Regards,
Kevin Babcock
Tags
Grid
Asked by
Craig
Top achievements
Rank 1
Answers by
Kevin Babcock
Top achievements
Rank 1
Share this question
or