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

[Solved] RadGrid used to only input data

1 Answer 126 Views
Input
This is a migrated thread and some comments may be shown as answers.
Ryan Pope
Top achievements
Rank 1
Ryan Pope asked on 16 Apr 2008, 07:10 PM
Hey,
I'm brand new today to telerik and am currently having trouble finding support for my specific problem.

I am making a RadGrid that contains a dropdownlist and textbox in each of their own columns. The dropdownlist is currently populating, but the problem i'm having is that I cannot specify how many rows of data I want to display. The only data needed from the database is from a stored procedure which is populated directed into the dropdownlist for each row without using edit mode.

I only want 8 rows to show up but I cannot get any data to show up unless i directly fill the RadGrid from the database.

If you have any suggestions on how to make the RadGrid show 8 rows at all times, or generate a specific number of rows if would greatly be appreciated.

This is my code here:

<

rad:RadGrid ID="RadGrid1" runat="server" GridLines="None" PageSize="8"

Skin="3D" DataSourceID="SqlDataSource3" EnableAJAX="True">

<PagerStyle PageButtonCount="8" />

<mastertableview allowcustomsorting="True" autogeneratecolumns="False"

datasourceid="SqlDataSource3">

<rowindicatorcolumn visible="False">

<HeaderStyle Width="20px" />

</rowindicatorcolumn>

<expandcollapsecolumn resizable="False" visible="False">

<HeaderStyle Width="20px" />

</expandcollapsecolumn>

<Columns>

<rad:GridTemplateColumn UniqueName="Account" DataField="Account"

HeaderText="GL Account" SortExpression="Account">

<ItemTemplate>

<asp:DropDownList ID="DropDownList2" runat="server"

DataSourceID="SqlDataSource2" DataTextField="Account" DataValueField="Account">

</asp:DropDownList>

</ItemTemplate>

</rad:GridTemplateColumn>

<rad:GridTemplateColumn UniqueName="Amount" DataField="Amount"

HeaderText="Amount">

<ItemTemplate>

<asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>

</ItemTemplate>

</rad:GridTemplateColumn>

</Columns>

</mastertableview>

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 17 Apr 2008, 06:49 AM
Hi Ryan,

RadGrid does not support unbound mode - you need to specify DataSource of DataSourceID. In your case this can be any collection with desired number of items (you can use NeedDataSource).

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Input
Asked by
Ryan Pope
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or