Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load rgd_CurrentGroups.DataSource = GetGroups() rgd_CurrentGroups.DataBind() RadListBox1.DataSource = GetGroups().DefaultView RadListBox1.DataBind() End SubPrivate Function GetGroups() As DataTable 'Dim UserName As String = Request.QueryString("UserName") Dim UserName As String = "fred" Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("IT_CentralConnectionString").ConnectionString, String) Dim connection As New SqlConnection(connectionString) Dim command As New SqlCommand(connectionString, connection) command = New SqlCommand("procGetGroupUsers", connection) command.CommandType = CommandType.StoredProcedure command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = UserName command.Connection.Open() Dim myDataAdapter As New SqlDataAdapter(command) Dim myDataSet As New DataSet Dim dtData As New DataTable myDataAdapter.Fill(myDataSet) Return myDataSet.Tables(0) command.Connection.Close() End FunctionHi telerik ppl:
Im using this code to swap languages for the column headers and also for the grouping fields labels within the group panel.
protected void RadGrid1_ItemCreated(object sender,GridItemEventArgs e){ if (e.Item is GridHeaderItem) { string strControl = ""; GridHeaderItem headerItem = e.Item as GridHeaderItem; headerItem["IDColumn"].Text = GetResource("Document ID"); headerItem["companyColumn"].Text = GetResource("Company"); headerItem["nameColumn"].Text = GetResource("Name, First"); headerItem["dueDateColumn"].Text = UBGlobal.GetResource("Due Date"); headerItem["ageColumn"].Text = GetResource("Age"); headerItem["assignedToColumn"].Text = GetResource("Assigned To"); headerItem["activityTypeCodeColumn"].Text = GetResource("Next Activity"); headerItem["subjectColumn"].Text = GetResource("Last Activity Notes"); headerItem["phoneColumn"].Text = GetResource("Phone"); } if (RadGrid1.GroupPanel.GroupPanelItems.Count > 0) { RadGrid1.GroupPanel.GroupPanelItems.Count.ToString()); for (int i = 0; i < RadGrid1.GroupPanel.GroupPanelItems.Count; i++) { RadGrid1.GroupPanel.GroupPanelItems[i].Text = GetResource(RadGrid1.GroupPanel.GroupPanelItems[i].Text); } } }
The problem here is that the objects within the Group Panel are not being translated when loading the grid or after draging and drop a column into the group panel.......the traslations are only being done when colapsing or expanding the grid rows.
I think this is because the Group Panel doesnt have elements when the ItemCreated Event is fired.....so my questions are:
1.- When is the Group Panel being populated.
and/or
2.- is there a better way to localize the Group Panel elements.......
This must be done in CODEBEHIND.....srry about the caps, are only to emphasize the fact that I cant use the fieldAlias property due to the fact that 3 different language translations must be done and the texts are changed so oftenly.
Thks in advance
imgTag.click(nodes[i], function (e) { var menu = e.data.get_contextMenu(); if (menu) menu.showAt(e.pageX, e.pageY); //$telerik.cancelRawEvent(e); e.stopPropagation();});
I am trying to get the user control on th eItemcommand of the grid but it is coming null. can some one please help as in what i am missing in here.
the user control comes null. please help.......
Code Behind
protected void GridResult_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.EditCommandName)
{
GridDataItem item = e.Item as GridDataItem;
UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
(userControl.FindControl(
"A") as HiddenField).Value = item["x"].Text;
(userControl.FindControl(
"B") as HiddenField).Value = item["Y"].Text;
}
}
<telerik:GridEditCommandColumn UniqueName="actionsCommandColumn" EditText="Go" ButtonType="PushButton">
</telerik:GridEditCommandColumn>
<
EditFormSettings PopUpSettings-Modal="true" InsertCaption="Actions" UserControlName="CustomControl.ascx"
EditFormType="WebUserControl">
</EditFormSettings>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ListaBase.UserControls.WebForm1" %><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <br /> <telerik:RadNotification ID="RadNotification1" runat="server" LoadContentOn="TimeInterval" Width="300" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true" Title="Received messages" OffsetX="-20" OffsetY="-20" TitleIcon="none" UpdateInterval="3000" AutoCloseDelay="1500" OnCallbackUpdate="OnCallbackUpdate"> <ContentTemplate> <asp:Literal ID="lbl" runat="server"></asp:Literal> </ContentTemplate> </telerik:RadNotification> </div> </form></body></html>namespace ListaBase.UserControls{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e) { int newMsgs = DateTime.Now.Second % 10; if (newMsgs == 5 || newMsgs == 7 || newMsgs == 8 || newMsgs == 9) newMsgs = 0; lbl.Text = "You have " + newMsgs + " new messages!"; RadNotification1.Value = newMsgs.ToString(); } }}