Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
86 views
Hi,

As a Telerik newbie, I'd like to seek some wisdom on RadGrid implementation. I have a single ASP.NET page that is structured with two custom user controls: one for getting user inputs and another for displaying results based on inputs. The custom controls look like the following:

// ctrlInput.ascx.cs
// consists of several controls (dropdown lists, checkboxes and a submit button)
  
public event EventHandler BtnClickEvent;
protected void Btn_Click(object sender, EventArgs e)
{
    BtnClickEvent(this, e);
}

//ctrlRadGrid.ascx.cs
//display result table based on ctrlInput values
  
public event EventHandler MyGridNeedDataSource;
          
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    MyGridNeedDataSource(this, e);
}

When user makes proper selection on ctrlInput and then click on submit button, BtnClickEvent will be raised to the containing aspx page, which looks like this:

// MyPage.aspx.cx
  
protected void Page_Init(object sender, EventArgs e)
{
    ctrlInput1.BtnClickEvent += new EventHandler(Foo_btnClickEvent);
    ctrlRadGrid1.MyGridNeedDataSource += new EventHandler(myGrid_NeedDataSource);
}
          
protected void Page_Load(object sender, EventArgs e)
{
    // toggle panel visibility
    if (!IsPostBack)
    {
        pnlInputs.Visible = true;
        pnlResults.Visible = false;
    }
    else
    {
        pnlInputs.Visible = false;
        pnlResults.Visible = true;              
    }
}
          
protected void myGrid_NeedDataSource(object sender, EventArgs e)
{
    if (ViewState["MyParams"] != null)
      {
         myGrid.DataSource = GetData(ViewState["MyParams"]);
      }
}
          
protected void Foo_btnClickEvent(object sender, EventArgs e)
{
    var ctrl = (ctrlInput)sender;
      ViewState["MyParams"] = ctrl.InputParams;
}
 
private DataTable GetData(string param)
{
    //DONE: call stored procedure with param
}

When myGrid_NeedDataSource fires for the first time, there's nothing to pass to GetData because Foo_btnClickEvent, which contains user's inputs, is always fired "afterwards". Can someone please shed some lights on how to achieve this or even suggest a better design/implementation?

Thanks in advance,


 



Archen
Top achievements
Rank 1
 asked on 08 Oct 2013
2 answers
68 views
how to proceed with an element RadSocialShare radlistview fed on the client side with JSON?
Marco Antonio
Top achievements
Rank 1
 answered on 08 Oct 2013
3 answers
112 views
Hello,

I am using:
  • RadControls for ASP.NET v. 2013.2.717.40
  • .NET Framework 4.0
  • Windows 7 Enterprise 64-bit
  • Visual Studio 10
  • IE 9 and Firefox 24

I am trying to create an application based on the Window - RadWindow and MDI.  So far, most everything is working as it should.  The problem is that the Minimize button on each of the RadWindows does not work properly.  Sometimes it works one time only if I click it right after opening a RadWindow, then it stops working all together.

I try to post an example application but your online demo has this problem as well.

Is there a fix for this problem?

Thanks,
Randall Price
Senior Developer
Virginia Tech
Randall
Top achievements
Rank 2
 answered on 08 Oct 2013
12 answers
242 views
Hello,

I have a TabStrip with a scheduler inside each Tab.  On FormLoad I load the info inside each Scheduler.
It seems that when a Scheduler is inside a Tab, all the appointments have Width: 0px, except for the tab that is selected.
If I change Tabs and refresh, the appointments will show, but will disappear in the other Tabs.

You can look at examples attached.

Thank you,

Jeremy
Plamen
Telerik team
 answered on 08 Oct 2013
1 answer
1.1K+ views
i'm setting the scroll area of the radgrid dynamically on gridcreated:

               var heightResolution = screen.height;
                var screenHeight = heightResolution - (heightResolution * 0.40);

                $get("content").style.height = screenHeight;

                var scrollArea = sender.GridDataDiv;

                scrollArea.style.height = screenHeight + "px";

is there any way to do something similar with the drop down portion of the radcombobox?

I'd like to set the height to a specific percentage of the page based on user's resolution.
Hristo Valyavicharski
Telerik team
 answered on 08 Oct 2013
2 answers
62 views
Hi

I migrated my application from .NET 1.1 to 3.5. We are using Rad Editor. After migration we are getting following error. 

'xhtml' is not a member of 'Telerik.Web.UI.RadEditor' - Please let me know any additional references we need add? 

Thanks and Regards 

Manivannan Nandagopalan

Manivannan
Top achievements
Rank 1
 answered on 08 Oct 2013
2 answers
283 views
I've got my DatePicker (and calendar and input), but it doesn't work with this "yyyyMMdd" format. It works with spaces or characters between, but not all together. Why not? When I try to use this format and pick a date from the calendar, the input part gives me the little warning sign. Some relevant code:

<telerik:RadCalendar runat="server" ID="RadCalendar"/>
<telerik:RadDatePicker runat="server" ID="rdpRequestDate" SharedCalendarID="RadCalendar">>
      <DateInput DateFormat="yyyyMMdd" DisplayDateFormat="yyyyMMdd" />
</telerik:RadDatePicker>
J
Top achievements
Rank 1
 answered on 08 Oct 2013
5 answers
247 views
I can't seem to get the export to excel button to work in internet explorer version 9.0.8112.16421, both with and without ajax. Clicking the export button does not produce any download prompt, nothing happens at all. Writing a separate button to call the export in code-behind doesn't work either. Even the demo does not work. Tried visiting http://demos.telerik.com/aspnet-ajax/grid/examples/export/biffexport/defaultcs.aspx and clicking on the export button, no dice.

Seems to occur only for IE version 9.0.8112.16421 (that's the version on my pc). No problem for IE version 8, or chrome or fire fox or opera (working well). Anyone experiencing the same issue? Is this an IE specific bug, specific to this version? Any fix for this?

Thanks for reading
Joey
Top achievements
Rank 1
 answered on 08 Oct 2013
3 answers
132 views
Hi, I have a currency value column in a radgrid, and exporting to excel using this function for formatting the currency cells

        protected void RadGrid_OnExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
        {
            if (e.FormattedColumn.DataType == typeof (long))
            {
                e.Cell.Style["mso-number-format"] = "Currency";
            }
       }

This is based on advice in another post in this forum. Works very well, but it doesn't format the footer item which is an aggregated sum value. How do I format the footer to be currency as well?

Thanks for reading
Joey
Top achievements
Rank 1
 answered on 08 Oct 2013
1 answer
247 views

Hi,

How to open a radwindow on row double click in a radgrid.

Thanks,
Ryan.
Shinu
Top achievements
Rank 2
 answered on 08 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?