Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Custom bindings with DataSource
posted

 How make custom binding in UltraWeGrid (last version) like in this video http://www.asp.net/LEARN/3.5-videos/video-500.aspx

Thanks.

Parents
  • 28464
    posted

    Hello,

    This video features the newly introduce (in .NET SP1) EntityDataSource declarative datasource control. I played a bit with the control against UltraWebGrid and indeed, currently we do not support it out of the box.

    I played a bit with the new control and managed to make UltraWebGrid and EntityDataSource play nicely, you just need to disable to AllowPage and AllowSort properties of the EntityDataSource. This could either be a problem in the grid or most probably it is just me still trying to figure out how EntityDataSource works. In any case, I will talk to the development team and we willl make sure we fully support that.

    Here is my code - is this applicable in your case?

                <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"
                    Width="825px" oninitializedatasource="UltraWebGrid1_InitializeDataSource"
                    onpageindexchanged="UltraWebGrid1_PageIndexChanged"
                    DataSourceID="EntityDataSource1">
                    <Bands>
                        <igtbl:UltraGridBand>
                            <Columns>
                                <igtbl:UltraGridColumn BaseColumnName="Address" IsBound="True" Key="Address">
                                    <Header Caption="Address">
                                    </Header>
                                </igtbl:UltraGridColumn>
                                <igtbl:UltraGridColumn BaseColumnName="City" IsBound="True" Key="City">
                                    <Header Caption="City">
                                        <RowLayoutColumnInfo OriginX="1" />
                                    </Header>
                                    <Footer>
                                        <RowLayoutColumnInfo OriginX="1" />
                                    </Footer>
                                </igtbl:UltraGridColumn>
                                <igtbl:UltraGridColumn BaseColumnName="CompanyName" IsBound="True"
                                    Key="CompanyName">
                                    <Header Caption="CompanyName">
                                        <RowLayoutColumnInfo OriginX="2" />
                                    </Header>
                                    <Footer>
                                        <RowLayoutColumnInfo OriginX="2" />
                                    </Footer>
                                </igtbl:UltraGridColumn>
                                <igtbl:UltraGridColumn BaseColumnName="ContactName" IsBound="True"
                                    Key="ContactName">
                                    <Header Caption="ContactName">
                                        <RowLayoutColumnInfo OriginX="3" />
                                    </Header>
                                    <Footer>
                                        <RowLayoutColumnInfo OriginX="3" />
                                    </Footer>
                                </igtbl:UltraGridColumn>
                            </Columns>
                           
                            <RowTemplateStyle BackColor="White" BorderColor="White" BorderStyle="Ridge">
                                <BorderDetails WidthBottom="3px" WidthLeft="3px" WidthRight="3px"
                                    WidthTop="3px" />
                            </RowTemplateStyle>
                            <AddNewRow View="NotSet" Visible="NotSet">
                            </AddNewRow>
                        </igtbl:UltraGridBand>
                    </Bands>
                    <DisplayLayout BorderCollapseDefault="Separate" Name="UltraWebGrid1" AllowUpdateDefault="Yes"
                        RowHeightDefault="20px" Version="4.00">
                        <FrameStyle BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt"
                            Width="825px">
                        </FrameStyle>
                        <ClientSideEvents  MouseDownHandler="AfterExitEditMode" />
                        <Pager>
                            <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                <BorderDetails ColorLeft="White" ColorTop="White" />
                            </PagerStyle>
                        </Pager>
                        <EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
                        </EditCellStyleDefault>
                        <HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid">
                            <BorderDetails ColorLeft="White" ColorTop="White" />
                        </HeaderStyleDefault>
                        <RowStyleDefault BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"
                            Font-Names="Verdana" Font-Size="8pt">
                            <Padding Left="3px" />
                            <BorderDetails ColorLeft="White" ColorTop="White" />
                        </RowStyleDefault>
                        <AddNewBox>
                            <BoxStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
                                <BorderDetails ColorLeft="White" ColorTop="White" />
                            </BoxStyle>
                        </AddNewBox>
                        <ActivationObject BorderColor="" BorderWidth="">
                        </ActivationObject>
                    </DisplayLayout>
                </igtbl:UltraWebGrid>


        <asp:EntityDataSource ID="EntityDataSource1" runat="server"
            AutoGenerateOrderByClause="True" AutoGenerateWhereClause="True"
            AutoPage="False" AutoSort="False" ConnectionString="name=NorthwindEntities"
            DefaultContainerName="NorthwindEntities" EntitySetName="Customers"
            Select="it.[Address], it.[City], it.[CompanyName], it.[ContactName]">
        </asp:EntityDataSource>

Reply Children