views:

39

answers:

1

Greetings Everyone..i just wanna ask is it possible to set a maximum length in my field in gridview?

Below is my gridview sample that retrieve a formatted html in my database..All i want to achieve is to limit the maximum length of characters i.e "50" then automatically create a pagination for the succeeding characters..to be posted in the gridview

 <div id="GridScroll" class="grid_scroll">
            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" BorderStyle="None" 
        GridLines="None"
    DataSourceID="SqlDataSource1" Height="308px" Width="1174px" ShowHeader="False">
    <Columns>
        <asp:TemplateField SortExpression="NewsText" ShowHeader="False">
            <ItemTemplate>
                <asp:Literal EnableViewState="false" ID="literal1" Text='<%# Bind("NewsText") %>' mode="PassThrough" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

Any advise or suggestion is highly sought...thank you

A: 

try to set fixed width on asp:Literal object

i don't get it.. i don't even see a width property in my literal...if you don't mind.. can you please show me how? is this a function or something..thanks
Kid