Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
720 views

All,

Below is the code for my rad grid, and I want to get the selected item value of the rad combo box "not text" in gridbatchedit command.

 command.NewValues["Description"]   --want to text the selected item value, instead of text

protected void rgReleaseSchedule_Prerender(object sender, EventArgs e)

{

{

SavedChangesList.ForeColor = System.Drawing.Color.Red;

RadComboBox ddlDesc = rgReleaseSchedule.FindControl(rgReleaseSchedule.MasterTableView.ClientID + "_Description").FindControl("rdDescription") as RadComboBox;

var description = IoC.Current.Resolve<IReleaseService>().ReleaseListScheduleTitle();

ddlDesc.DataSource = description;

ddlDesc.DataTextField = "Description";

ddlDesc.DataValueField = "TitleID";

ddlDesc.DataBind();

}

}

protected void rgReleaseSchedule_BatchEditCommand(object sender, Telerik.Web.UI.GridBatchEditingEventArgs e)

{

try

{

SavedChangesList.Items.Clear();

SavedChangesList.ForeColor = System.Drawing.Color.Red;

foreach (GridBatchEditingCommand command in e.Commands)

{

Hashtable newvalues= command.NewValues;

if (command.Type == GridBatchEditingCommandType.Update)

{

if (command.NewValues["Date"].ToString() != "" && command.NewValues["Time"].ToString() != "" && command.NewValues["Description"].ToString() != "")

{

Int32 result = IoC.Current.Resolve<IReleaseService>().ReleaseListUpdate((Int32)command.Item.OwnerTableView.DataKeyValues[command.Item.ItemIndex]["ID"],

(DateTime)command.NewValues["Date"], command.NewValues["Time"].ToString(), command.NewValues["Description"]);

}

 

Sreekanth
Top achievements
Rank 1
 answered on 02 Dec 2014
1 answer
56 views
Hi,

I'm using Telerik RadControls for ASP.NET Ajax v2012.3.1308.35 and the RadFilterQueryProvider.ProcessGroupInternal(RadFilterGroupExpression group
) works well.

But when I upgrade to use Telerik UI for ASP.NET AJAX v2014.2.724.45, the function does not work, although no error/exception found.

I don't know if I miss something here. Please help to verify my problem
Pavlina
Telerik team
 answered on 02 Dec 2014
3 answers
162 views
Should the sample code at:

http://www.telerik.com/help/aspnet-ajax/page-layout-responsive-design-overview.html 

be specifying gridtype="Fixed" instead of gridtype="Fluid" ?
Boyan Dimitrov
Telerik team
 answered on 02 Dec 2014
1 answer
187 views
Hello,
I'm using C# with VS 2010 Ultimate
The RadMenu OnItemClick event does not fire on the sub menu items. (it does fire on the main/top menu.
How can I get the sub menu's to trigger/fire the OnItemClick Event as well?

aspx code for menu:
<telerik:RadMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_ItemClick"></telerik:RadMenu>

C# code:
    private void BuildMenu_CreateDocuments()
    {
        RadMenu1.Items.Add(new RadMenuItem("Logout"));
        RadMenu1.Items.Add(new RadMenuItem("Setting"));
        RadMenu1.Items.Add(new RadMenuItem("Document"));

        List<Model.Common.PartnerDocument> lstPartnerDocuments = new BL.PartnerDocumentBL().GetPartnerDocuments(m_intCustomerID, m_intPartnerID, m_bAdmin);

        if (lstPartnerDocuments.Count > 0)
        {
            for (int i = 0; i < lstPartnerDocuments.Count; i++)
            {
                RadMenu1.Items[ID_MENU_DOCUMENT].Items.Add(new RadMenuItem("Create " + lstPartnerDocuments[i].DocumentName, lstPartnerDocuments[i].PageUrl));
            }
        }
    }


Plamen
Telerik team
 answered on 02 Dec 2014
3 answers
76 views
Hi,

I am looking for a control which allows to display/preview and play files for all formate (Images, PDFs, MS Word, Video, Flash).

Thanks,
Nitin
Vessy
Telerik team
 answered on 02 Dec 2014
1 answer
97 views
Hi,

I've see an issue in my grid since I've made the last update with the telerik control panel. I don't know if it is due to the update or a change in my code. 
I have this grid :

<telerik:RadGrid ID="TrainingPlanRadGrid" runat="server" Width="100%"
   AutoGenerateColumns="false" AllowPaging="true" PageSize="13"
   ShowHeader="true" ShowFooter="false" ShowGroupPanel="false"
   ShowStatusBar="false"             
   OnNeedDataSource="TrainingPlanRadGrid_NeedDataSource"  
   OnItemDataBound="TrainingPlanRadGrid_ItemDataBound"
   AllowMultiRowSelection="true" AllowAutomaticInserts="false"
   AllowAutomaticDeletes="false"
   AllowAutomaticUpdates="false" AllowSorting="true"
   AllowFilteringByColumn="false"
   BorderStyle="None" Style="overflow: auto;"
   HeaderStyle-Font-Bold="true">
      <MasterTableView TableLayout="Fixed" Width="100%" ClientDataKeyNames="ID">
         <Columns>
            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" Display="true">
               <ItemTemplate>
                  <asp:CheckBox ID="CheckBox1" runat="server"
                     OnCheckedChanged="ToggleRowSelection"
                     AutoPostBack="True" />
               </ItemTemplate>
               <HeaderTemplate>
                  <asp:CheckBox ID="headerChkbox" runat="server" 
                     OnCheckedChanged="ToggleSelectedStatePage" AutoPostBack="True" />
               </HeaderTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="RequestId" HeaderText=""
               DataField="ID" Visible="false" />
            <telerik:GridDateTimeColumn UniqueName="RequestDate" HeaderText="RequestDate"
               DataField="REQUEST_DATE" HeaderStyle-Wrap="false" HeaderStyle-Width="12%"
               HeaderStyle-HorizontalAlign="Right" ItemStyle-Width="12%"
               ItemStyle-HorizontalAlign="Right" />
            <telerik:GridBoundColumn UniqueName="RequestUser" DataField="USER_NAME"
               HeaderText="RequestUser" HeaderStyle-Wrap="false" HeaderStyle-Width="15%"
               ItemStyle-Width="15%" />
            <telerik:GridBoundColumn UniqueName="RequestUserOrg" DataField="ORG_LABEL"
               HeaderText="RequestUserOrg" HeaderStyle-Wrap="false" HeaderStyle-Width="15%"
               ItemStyle-Width="15%" />
            <telerik:GridBoundColumn UniqueName="RequestAdmin" DataField="ADMIN_NAME"
               HeaderText="RequestAdmin" HeaderStyle-Wrap="false" HeaderStyle-Width="15%"
               ItemStyle-Width="15%" />
            <telerik:GridBoundColumn UniqueName="RequestCourse" DataField="COURSE_NAME"
               HeaderText="RequestCourse" HeaderStyle-Wrap="false" HeaderStyle-Width="25%"
               ItemStyle-Width="25%" />
            <telerik:GridTemplateColumn UniqueName="RequestStatus" HeaderText="RequestStatus"
               HeaderStyle-Wrap="false" HeaderStyle-Width="12%" ItemStyle-Width="12%"
               ItemStyle-Wrap="false">
               <ItemTemplate>
                  <%# GetRequestStatus(Eval("REQUEST_STATUS").ToString())%>
               </ItemTemplate>
            </telerik:GridTemplateColumn>
         </Columns>
         <PagerStyle AlwaysVisible="false" Mode="NumericPages" />
      </MasterTableView>
      <HeaderStyle Font-Bold="true" />
      <ClientSettings Selecting-AllowRowSelect="true">
         <ClientEvents OnRowDblClick="editTrainingPlan"  />
      </ClientSettings>
</telerik:RadGrid>


This is the function selecting programmatically the row (on checkbox click) :

protected void ToggleRowSelection(object sender, EventArgs e)
        {
            GridItem item = ((sender as CheckBox).NamingContainer as GridItem);
            item.Selected = (sender as CheckBox).Checked;
            ...
        }

There is no exception thrown during the C# method.
But now, when I call this in js :

var grid = $find("TrainingPlanRadGrid");
var gridSelectedItems = grid.get_selectedItems();

I get an array with one "null" entry for each item I have selected in my C# code. And if I select a row by clicking on I get an entry containing a [Telerik.Web.UI.GridDataItem].

I can't use the auto-generated select checkbox column because I have extra features to add but I need to access in js and in C# to selected columns.

Do you see where I am doing something wrong ?
Eyup
Telerik team
 answered on 02 Dec 2014
2 answers
110 views
Hi,
I have a master page that contains a radSkinManager (that display a skin chooser). All child pages that contain rad controls seem to inherit the skins just fine but the background of my page style with default style - I assume that all controls must be inside some rad container to get styled properly?
Al
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 02 Dec 2014
2 answers
76 views
The problem which i am facing is that i have an ExportToExcel image button in the grid.When i click on that , it is not asking for 'Open' or 'Save'  file in Excel. Instead the datas which are to be in the Excel is displayed in UI grid itself. The excel button is in the "GridFilteringItem" . Please note that the grid is placed within RadAjaxPanel.The code which I have used is

public void grid _ItemCreated(object sender, GridItemEventArgs e)
{
//if (e.Item is GridCommandItem)
//{
// Button btncmd = (e.Item as GridCommandItem).FindControl("ExportToExcelButton") as Button;
// (this.Master.FindControl("ScriptManagerMain") as System.Web.UI.ScriptManager).RegisterPostBackControl(btncmd);
//}
if (e.Item is GridHeaderItem)
{
GridHeaderItem headerItem = (GridHeaderItem)e.Item; // access the header row
Button btnUpdate = new Button(); // creating a new checkbox
btnUpdate.ID = "btnUpdate";
btnUpdate.Text = "Update Selected";
btnUpdate.OnClientClick = "ValidateCheckBox()";
btnUpdate.Click += new EventHandler(btnUpdateSelected_Click);
headerItem["Update"].Controls.Add(btnUpdate); // adding the checkbox to the control collection of the required cell
btnUpdate.Visible = true;
}
if (e.Item is GridFilteringItem)
{
ImageButton ExportToXLSButton = new ImageButton();
ExportToXLSButton.ID = "CustomExportToExcelButton";
ExportToXLSButton.AlternateText = ExportToXLSButton.ToolTip = "Export To Excel";
ExportToXLSButton.ImageUrl = "~/images/ExportToExcel.gif";
ExportToXLSButton.CommandName = RadGrid.ExportToExcelCommandName;
(e.Item as GridFilteringItem)["Update"].Controls.Add(ExportToXLSButton);
}
}

In ItemCommand

if (e.CommandName == RadGrid.ExportToExcelCommandName)
{
grid.ExportSettings.FileName = String.Format("X_{0}_to_{1}",
dtStart.SelectedDate.Value.ToString("MM-dd-yyyy"), dtEnd.SelectedDate.Value.ToString("MM-dd-yyyy"));
{
if (col.UniqueName != "X")
{
col.Visible = true;
}
}

grid.ExportSettings.ExportOnlyData = true;
grid.ExportSettings.IgnorePaging = true;
grid.ExportSettings.OpenInNewWindow = true;
grid.Rebind();
grid.MasterTableView.ExportToExcel();


I had even referred to the below links but i could not find any solution for this

http://www.telerik.com/forums/radgrid-export-to-excel-problem

http://www.telerik.com/help/aspnet-ajax/grid-export-with-ajax-enabled.html 

http://www.telerik.com/help/aspnet-ajax/ajax-exclude

Please help me out on this issue

Thanks
Saurabh
Top achievements
Rank 1
 answered on 02 Dec 2014
9 answers
118 views
Hello,

I have implemented a radscheduler with a grid and drag/drop functionality much like your sample here:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/draganddropintegration/defaultcs.aspx?product=scheduler

The only difference is I don't bind the grid with a datasource but in the onneeddatasource event in code behind.
Everything is working great exept that when I delete an appointment I want the grid to rebind because the deleted item should reappear in the grid.

On which event do I call the Rebind event of the grid? I tried the AppointmentDelete but it seems to be to early.

Thanks,

Frank
Frank
Top achievements
Rank 1
 answered on 02 Dec 2014
2 answers
195 views
I've implemented a grid with toolbar and a filtering option. I'd like to turn the grids filter on and off when clicking the toolbar button "Filter".

Here is the aspx code and the JS function being called on client click. Most of it is from the forum or the documentation:

            
<telerik:RadToolBar runat="server" ID="RadToolBar1" OnClientButtonClicked="onButtonClicked"
EnableViewState="False" ResolvedRenderMode="Classic" SingleClick="none">
    <Items>
        <telerik:RadToolBarButton Text="Open" ImageUrl="~/Images/reply.gif"
            CommandName="openMail" />
        <telerik:RadToolBarButton IsSeparator="true" />
        <telerik:RadToolBarButton CommandName="showFilter" Text="Filter" CheckOnClick="True">
        </telerik:RadToolBarButton>
    </Items>
</telerik:RadToolBar>


function onButtonClicked(sender, args) {
    var commandName = args.get_item().get_commandName();
    if (commandName == "showFilter") {
        if (tbButton.get_checked()) {
            alert("checked")
            $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();
        } else {
            alert("unchecked")
            $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem();
        }
    }
}

And I have some code handling other button clicks in VB.

Private Sub RadToolBar1_ButtonClick(sender As Object, e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ButtonClick
 
    Dim tbBtn As RadToolBarButton = TryCast(e.Item, RadToolBarButton)
 
    Select Case tbBtn.CommandName.ToLower
        Case "openmail"
            OnMessageListSelectionChanged(displayedID, True, False)
    End Select
 
End Sub


My problem is that tbButton.get_checked() always returns true. No matter what the current state is. I assume that there is a second request setting it back... Any ideas how to solve it? Or what exactly the problem is?

Thanks a lot in advance.
Martin
Top achievements
Rank 1
 answered on 02 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?