Welcome Guest Search | Active Topics | Sign In | Register

GridView Excel Style - formatting data in column when binding Options
Mona
Posted: Friday, April 9, 2010 4:16:58 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
Hi,

How could I do something like this with your grid?

<eo:StaticColumn DataField="DatetimeStamp" DataFormat='<%# ByteToString(Container.DataItem("DatetimeStamp")) %>' HeaderText="" Visible="true">
</eo:StaticColumn>

I get this error message Databinding expressions are only supported on objects that have a DataBinding event. EO.Web.StaticColumn does not have a DataBinding event.

I would like to format this at runtime...

Thanks
eo_support
Posted: Saturday, April 10, 2010 7:27:18 PM
Rank: Administration
Groups: Administration

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

Your data is bind to grid row, not grid column. So obviously the column object will not allow binding expression.

Thanks
Mona
Posted: Monday, April 12, 2010 1:50:44 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
Maybe my question was formulated wrong. So what would be the equivalent of:

<asp:TemplateField HeaderText="Travel Hours">
<HeaderStyle HorizontalAlign="Center" Wrap="True" />
<ItemStyle HorizontalAlign="Right" />
<ItemTemplate>
<asp:Label runat="server" Text='<%# FormatMyDate(DataBinder.Eval(Container.DataItem, "BusinessTravelHours"),"d") %>' id="Label1"></asp:Label>
</ItemTemplate>
</asp:TemplateField>


How would you accomplish this with the Grid - Excel style? All I'm trying to do is format the data before loading.

Thanks
eo_support
Posted: Monday, April 12, 2010 2:10:46 PM
Rank: Administration
Groups: Administration

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

You will just use a DateTimeColumn and set the column's DataField to "BusinessTravelHours". There is no direct equivalent of server templates in our Grid because the Grid needs to dynamically format cell text on the client side.

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.