Welcome Guest Search | Active Topics | Sign In | Register

Need help making grid interactive allowing records to be inserted and edited, etc. Options
MarkITP
Posted: Thursday, February 25, 2010 9:56:02 AM
Rank: Member
Groups: Member

Joined: 10/13/2009
Posts: 14
I need an interactive grid that allows data from an order to be displayed and modified as needed. The data will be queried from several SQL tables and displayed in the grid but we need some of the data to be displayed as hotlinks and other data to be manually entered via pulldowns, etc. I have numbered my questions accordingly. Thanks in advance for any help you can provide.
1. I need to make the grid allow for header text that autowraps, meaning the column titles be allowed to take wrap around to 2 or 3 lines instead of going straight across b/c I may not need the column itself to be that wide.
2. I need to be able to edit data interactively and have certains pieces of data be hotlinks to a table for editing...i.e. a rate class might show 125 but be a link to a rate class table. A bill of lading may be something like '125-29987672' and be a hot link to the data on the bill of lading, PO, or Ack#, etc.
This is a grid used for bringing up data from an order. Some pieces of the data need to be hot links to the order itself so that some of the values can be modified.
3. Also, there is a field called "conversion factor" that may have a value in it like '1 / 3' which means one inventory unit = 3 shipping units (i.e. 1 bed = 1 headboard, 1 footboard, & 1 set of rails) which needs to be a hotlink to the "conversion factor" table to display to the user what the '1 / 3' means. I'd like to add a small button with a magnifying glass in it that could be clicked to bring up the entire "Conversion Factor" screen so that they could change what conversion factor they're using on the fly.
4. When creating the columns in the grid, I can choose text, row#, date, etc. but can't choose a dropdown. How can I add a dropdown as an option b/c the user will need to choose data from a dropdown as the value for that column (i.e. choosing a category from a dropdown)

I can email you a screenshot of what I have and what I want. I'm not sure how to do everything I want to do w/ a grid OR if a grid is even the best object to use. PLEASE HELP!!!
eo_support
Posted: Thursday, February 25, 2010 12:11:34 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The Grid may not be the best object for you to use in this case. The main benefit of our Grid is client side editing and it allows you to edit multiple records without posting back. If these are not your main goals, then a traditional DataGrid/GridView might work better for you because it has a simpler DHTML structure and you can always go back to the server to update it anyway you want. If you do wish to use our Grid:

1. I believe it does that automatically. The only thing you need to be aware of is some built-in Grid templates have a background image set in the header style. That background image does not automatically grow taller when your header text wraps into multiple line. So make sure you do not use any background images in your header style;

2. You can do that by changing a Grid's DataFormat property. For each cell there are two piece of information: a. cell value is the value you pass to the Grid. b. cell HTML is the final HTML displayed in the Grid cell. Grid takes your cell value, format it will DataFormat to produce cell HTML. So for example, if your cell value is "123", and your DataFormat is "<a href='OrderDetails.aspx?id={0}'>{0}</a>", then the Grid will display a HTML link in the cell;

3. You can do the same as #2;

4. Dropdowns are supported through custom columns. Here is a working example:

http://demo.essentialobjects.com/Default.aspx?path=Grid\_i1\grid_custom_column

You can also find more details about how to use custom column here:

http://doc.essentialobjects.com/library/1/grid/custom_column.aspx

Hope this helps.

Thanks!
MarkITP
Posted: Friday, February 26, 2010 3:23:03 PM
Rank: Member
Groups: Member

Joined: 10/13/2009
Posts: 14
Thanks for your help! I do still have a few issues though:
1. OK, I removed the background image and then made the header height larger so now I can see all of my header text. The problem now is that the divider line between the header is not growing as the height did, so it looks like part of my header text is in mid-air. Also, I'd like the make the entire header bar in charcoal grey. Once I removed the background image, the color that was in the header bar (I had "Style2" of the prebuilt grids) - which I liked but now I have no color whatsoever.
2. Just for screenshot purposes, I had entered a text value for each column in the column property. I went back to the column property and copied/pasted your line of code into the "DataFormat" property and changed the aspx name to 'EditFactors.aspx'. I tried entering the line with and without the " (at the beginning and ending of the line). Now when I run the screen, I still have my text values but the value do seem to be a link (meaning the text isn't showing in a color or w/ a line under it and the cursor doesn't show as a hand when passing over it or anything that leads me to believe it is indeed a link). I copied and pasted it in the DataFormat property of the column as:
"<a href='EditFactors.aspx?id={0}'>{0}</a>"

and tried it as just w/o the leading and trailing quotes:
<a href='OrderDetails.aspx?id={0}'>{0}</a>

Thanks again in advance!
eo_support
Posted: Friday, February 26, 2010 6:00:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

As to your questions:

1. You must also change the grid' ColumnHeaderHeight. The Grid always uses a fixed column header height. This means it will not grow automatically. So for example, if you anticipate your header text to be two rows most of the time, you can set the height to make sure it can display two rows. Usually you also need to set the column header's style to have a background color. Please see here for more details on how to set various styles:

http://doc.essentialobjects.com/library/1/grid/styling.aspx

2. That is normal. "Text" and "Value" are different things, once you set Text, it overrides everything else and display the text as is. You can set the Grid cell value through code or data binding, but not through .aspx directly.

Thanks
MarkITP
Posted: Monday, March 1, 2010 9:29:34 AM
Rank: Member
Groups: Member

Joined: 10/13/2009
Posts: 14
Attached is the code for 2 grids. The first one shown below is the one that has the problems. The second one looks like I want it to. They both were set to use "Style2" grid template but I removed the background image on the first one b/c I needed the column header height to be around 50px to accommodate multiple lines. I had already adjusted the column header height prior to my last message. The second grid does not need a larger column header height b/c the column header names are only one word. The problem is that the column header on the first grid does not have the "column header divider" tall enough to accommodate the 50px and does not have the column header bottom horizontal line either. If the first grid can look like the second grid but just have a taller header, than I'll be very happy. Thanks again. Mark S.

<eo:Grid ID="Grid1" runat="server" BorderColor="Black" BorderWidth="1px"
ColumnHeaderAscImage="00050403" ColumnHeaderDescImage="00050404"
ColumnHeaderDividerImage="00050402" ColumnHeaderDividerOffset="6"
ColumnHeaderHeight="50" FixedColumnCount="1" Font-Bold="False"
Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="9pt"
Font-Strikeout="False" Font-Underline="False" GridLineColor="240, 240, 240"
GridLines="Both" Height="200px" ItemHeight="18"
style="z-index: 1; left: 10px; top: 440px; position: absolute; height: 202px; width: 1180px"
Width="380px" AllowNewItem="True" AllowColumnReorder="True">
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ItemStyles>
<eo:GridItemStyleSet>
<ItemStyle CssText="background-color: white" />
<CellStyle CssText="padding-left:8px;padding-top:2px; color:#black;white-space:nowrap;" />
</eo:GridItemStyleSet>
</ItemStyles>
<ColumnTemplates>
<eo:TextBoxColumn>
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
<eo:DateTimeColumn>
<DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19"
DayHeaderFormat="FirstLetter" DisabledDates="" OtherMonthDayVisible="True"
SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon">
<TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
<SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
<CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
<TitleArrowStyle CssText="cursor:hand" />
<DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
<MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
<OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
<DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
</DatePicker>
</eo:DateTimeColumn>
<eo:MaskedEditColumn>
<MaskedEdit ControlSkinID="None"
TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
</MaskedEdit>
</eo:MaskedEditColumn>
</ColumnTemplates>
<ColumnHeaderTextStyle CssText="border-width: medium" />
<Columns>
<eo:StaticColumn DataField="Qty" HeaderText="Order Qty." Name="Qty" Text="3"
Width="60" DataType="Integer" ReadOnly="True">
</eo:StaticColumn>
<eo:StaticColumn DataField="Units" HeaderText="Shipping Units Rec'd" Name="Units"
Text="9" Width="70" DataType="Integer">
</eo:StaticColumn>
<eo:StaticColumn HeaderText="Conversion Factor" Name="Factor"
Text="1/3" Width="80"
DataFormat="&lt;a href='EditFactors.aspx?id={0}'&gt;{0}&lt;/a&gt;"
DataField="Factor">
</eo:StaticColumn>
<eo:StaticColumn DataField="InvUnits" HeaderText="Inventory Units Rec'd"
Name="InvUnits" Text="3">
</eo:StaticColumn>
<eo:StaticColumn HeaderText="Item#" Name="Style"
Text="2354-10" Width="75" DataField="Style">
</eo:StaticColumn>
<eo:StaticColumn DataField="Description" HeaderText="Item Description" Name="Description"
Text="KING LOUIS BED - MAHOGANY" Width="220">
</eo:StaticColumn>
<eo:StaticColumn DataField="RateClass" HeaderText="Rate Class" Name="RateClass"
Text="125" Width="95"
DataFormat="&quot;&lt;a href='RateClass.aspx?id={0}'&gt;{0}&lt;/a&gt;&quot;">
</eo:StaticColumn>
<eo:StaticColumn DataField="ShipperBOL" HeaderText="Shipper's BOL#"
Name="ShipperBOL" Text="125-29987672" Width="125"
DataFormat="&quot;&lt;a href='BillOfLading.aspx?id={0}'&gt;{0}&lt;/a&gt;&quot;">
</eo:StaticColumn>
<eo:StaticColumn DataField="PO" HeaderText="P.O./Order#"
Name="PO" Text="88987672-A" Width="80"
DataFormat="&quot;&lt;a href='OrderDetails.aspx?id={0}'&gt;{0}&lt;/a&gt;&quot;">
</eo:StaticColumn>
<eo:StaticColumn DataField="ACK" HeaderText="Shipper's Ack/Order#" Name="ACK"
Text="10-22998787822" Width="125"
DataFormat="&quot;&lt;a href='AckDetails.aspx?id={0}'&gt;{0}&lt;/a&gt;&quot;">
</eo:StaticColumn>
<eo:StaticColumn DataField="Wgt" HeaderText="Unit Wt." Name="Wgt" Text="9999.75"
DataType="Float" Width="75">
</eo:StaticColumn>
<eo:StaticColumn DataField="Cubes" DataType="Float" HeaderText="Unit Cube"
Name="Cubes" Text="8888.25">
</eo:StaticColumn>
<eo:StaticColumn DataField="UnitPrice" DataType="Float" HeaderText="Unit Price"
Name="UnitPrice" Width="85" DataFormat="$$$$$.$$" Text="9999.50">
</eo:StaticColumn>
</Columns>
<ColumnHeaderStyle CssText="padding-left:8px;padding-top:2px;" />
</eo:Grid>
eo_support
Posted: Monday, March 1, 2010 9:44:57 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to modify this property:

http://doc.essentialobjects.com/library/1/eo.web.grid.columnheaderdividerimage.aspx

This topic should give you more information on how to customizing the header:

http://doc.essentialobjects.com/library/1/grid/styling.aspx

Look for "Header Appearance" section.

Thanks!
MarkITP
Posted: Monday, March 1, 2010 10:14:25 AM
Rank: Member
Groups: Member

Joined: 10/13/2009
Posts: 14
I had seen that property but it doesn't let you adjust the height of the existing divider, rather all you can do is change what image you use for a header divider. I like the existing header divider but want to just make it longer. Are you saying I have to go to Paintbrush (or something like that) and design my own vertical line that is 50px in length??? I hope that isn't what you're saying. What about the horizontal line at the bottom of the header? I don't mean to ask alot of questions but I had already looked at everything you had suggested and had already played w/ that stuff before I had posted the questions.
eo_support
Posted: Monday, March 1, 2010 10:33:42 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. That is exactly what we meant. In fact for anything that is related to an image, your only options are use the image, use your own image, or do not use any image. This is the same for the header background image. It does not automatically grow.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.