<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
ReadOnly
=
"True"
UniqueName
=
"column1"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Seller"
HeaderText
=
"Seller"
ReadOnly
=
"True"
UniqueName
=
"column2"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Amount"
HeaderText
=
"Amount"
UniqueName
=
"column3"
>
</
telerik:GridBoundColumn
>
protected
void
grdSellers_ItemCommand(
object
source, GridCommandEventArgs e)
{
switch
(e.CommandName)
{
case
"Update"
:
GridEditableItem editedItem = e.Item
as
GridEditableItem;
TableCell cell = editedItem[
"column3"
];
string
itemValue = (cell.Controls[0]
as
TextBox).Text;
//Get Id of editable item ??
}
}
I have quite a complex set of classes which parses an XML file or RSS feeds.
I know that radgrid can bind to an arraylist, so I have this code:
protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
ArrayList arraylist = new ArrayList();
if (dict != null)
{
foreach (var v in dict)
{
arraylist.Add(new RSSFeedItem(v.Date, v.Description, v.Title, v.Title));
RadGrid1.DataSource = arraylist;
}
}
}
"dict" is a collection of articles in an RSS feed. So for every article inside, I add that article's date, link, description, etc to the array list, and then set the datasource to that arraylist.
On the last line of the code, I check the grid's state and it is containing the items (e.g. first pass in the loop, there is a count of 1, etc). Datasource has a count of 25 which contains the articles.
Also, how can I get the row count programatically?
Thanks
Protected
Sub
RadAjaxManager1_AjaxRequest(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.AjaxRequestEventArgs)
Handles
RadAjaxManager1.AjaxRequest
If
hdnMenu.Value =
"6"
Then
If
(e.Argument.StartsWith(
"ListesGroupes"
))
Then
If
e.Argument.ToString.Split(
"$"
)(1) =
"1"
Then
//do something
Else
// reset the panel bar
RadPanelBar1.ClearSelectedItems()
Dim
myItem
As
RadPanelItem =
DirectCast
(RadPanelBar1.FindItemByText(
"Mes alertes"
), RadPanelItem)
myItem.Selected =
True
myItem.ExpandParentItems()
End
If
End
If
Else
End
Sub
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"Server"
>
<
telerik:RadPanelBar
runat
=
"server"
ID
=
"RadPanelBar1"
Width
=
"100%"
Height
=
"100%"
PersistStateInCookie
=
"false"
OnClientItemClicking
=
"OnClientItemClicking"
EnableEmbeddedSkins
=
"false"
Skin
=
"IroiseSkin"
>
<
Items
>
<
telerik:RadPanelItem
Text
=
"Agendas"
Value
=
"AGENDA"
Expanded
=
"true"
PreventCollapse
=
"true"
>
<
Items
>
<
telerik:RadPanelItem
ImageUrl
=
"../Images/flyout_arrow.gif"
Text
=
"Mes RDV"
NavigateUrl
=
""
PostBack
=
"false"
Value
=
"AGENDA.RDV"
Selected
=
"true"
/>
<
telerik:RadPanelItem
ImageUrl
=
"../Images/flyout_arrow.gif"
Text
=
"Mes mémos"
NavigateUrl
=
""
PostBack
=
"false"
Value
=
"AGENDA.MEMO"
/>
<
telerik:RadPanelItem
ImageUrl
=
"../Images/flyout_arrow.gif"
Text
=
"Mes tâches"
NavigateUrl
=
""
PostBack
=
"false"
Value
=
"AGENDA.TACHE"
/>
<
telerik:RadPanelItem
ImageUrl
=
"../Images/flyout_arrow.gif"
Text
=
"Mes alertes"
NavigateUrl
=
""
PostBack
=
"false"
Value
=
"AGENDA.ALERT"
/>
<
telerik:RadPanelItem
ImageUrl
=
"../Images/flyout_arrow.gif"
Text
=
"Tout l'agenda"
NavigateUrl
=
""
PostBack
=
"false"
Value
=
"AGENDA.TOUT"
/>
<
telerik:RadPanelItem
ImageUrl
=
"../Images/flyout_arrow.gif"
Text
=
"Agendas groupes"
NavigateUrl
=
""
PostBack
=
"false"
Value
=
"AGENDA.GROUPE"
/>
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
</
asp:Content
>