Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
71 views
I've created a Dynamic RadGrid on a Web User Control (ascx), and it displays correctly. However when I click on the Edit button the grid simply disappears. In order to determine what is going on I've tried to connect the OnItemCommand Event, but it does not fire? Listed below is a scaled version of the Dynamic Grid Creation, which is being executed by the PageInit Method.

My goal is to have the Edit Popup Modal show up when the User Clicks Edit, and be able to then catch the Update Click in order to manage the update back to the Data Source.

 

protected void BuildGrid(DataRow curRow)
{
    var curGrid = new RadGrid
          {
              ID = curRow.Field<string>("tst_desc"),
              Skin = "Hay",
              GridLines = GridLines.Both,
              AutoGenerateColumns = false,
              AllowAutomaticUpdates = true
          };
    curGrid.MasterTableView.Name = curRow.Field<string>("tst_desc");
    curGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Bottom;
    curGrid.MasterTableView.TableLayout = GridTableLayout.Fixed;
    curGrid.MasterTableView.EditMode = GridEditMode.PopUp;
    curGrid.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.AutoGenerated;
    curGrid.MasterTableView.CommandItemSettings.ShowRefreshButton = false;
    curGrid.MasterTableView.CommandItemSettings.AddNewRecordText = "Add More " + curRow.Field<string>("tst_desc") + " Test Results";
    curGrid.NeedDataSource += new GridNeedDataSourceEventHandler(Grid_OnNeedDataSource);
    curGrid.ItemCommand += new GridCommandEventHandler(Grid_OnItemCommand);
    curGrid.ClientSettings.AllowKeyboardNavigation = true;
    var btnCol = new GridButtonColumn
         {
             ButtonType = GridButtonColumnType.ImageButton,
             HeaderText = "Edit",
             CommandArgument = "btnEdit",
             UniqueName = "btnEdit",
             CommandName = "Edit"
         };
    curGrid.MasterTableView.Columns.Add(btnCol);
    var gbcUpdBy = new GridBoundColumn
       {
           UniqueName = "UPDT_BY",
           HeaderText = "Last Updated By",
           DataField = "updt_by",
           ReadOnly = true
       };
    curGrid.MasterTableView.Columns.Add(gbcUpdBy);
    var gbcUpdDt = new GridBoundColumn
       {
           UniqueName = "UPDT_DT",
           HeaderText = "Last Updated",
           DataField = "updt_dt",
           DataFormatString = "{0:MM/dd/yy}",
           ReadOnly = true
       };
    curGrid.MasterTableView.Columns.Add(gbcUpdDt);
    PlaceHolder1.Controls.Add(curGrid);
    Session[curRow.Field<string>("tst_desc") + "ID"] = curRow.Field<int>("lab_tst_id").ToString(CultureInfo.InvariantCulture);
    PlaceHolder1.Controls.Add(new LiteralControl("<br />"));
    PlaceHolder1.Controls.Add(new LiteralControl("<br />"));
}
 
void Grid_OnItemCommand(object sender, GridCommandEventArgs e)
{
    var a = 123;
}
 
void Grid_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    var curGrid = sender as RadGrid;
    var gridName = curGrid.MasterTableView.Name;
    var hidTestId = Session[gridName + "ID"];
    curGrid.DataSource = ExecSQL.SQLData(_sqlStmt + " AND lt.lab_tst_id = " + hidTestId);
 
}
Andrey
Telerik team
 answered on 11 Jan 2013
1 answer
62 views
Hi,

I am currently working on RadChart, and we use StackColumns a lot.  It's been great for the most part, however, there are times when in our data, one of the values is very small relative to others.  This results in it's number label colliding with another one.  

Has anyone out there encountered this same problem and what was your approach?  My initial solution was to programmatically move tiny-value-items to another location, say the right of the data item.  But this still isn't good enough when you have several consecutive tiny values stacked up together.  They would all collide to the right this time.

Any thoughts/inputs?  Thanks in advance!

-Dino
Petar Kirov
Telerik team
 answered on 11 Jan 2013
1 answer
59 views
Good afternoon, everyone.

I'm developing a web app that utilizes the RadDocks, zones and layouts like in the "MyPortal" demo.  I've got the layouts working, and all the docks are loading whichever controls they're assigned.

One of these controls is a RadGrid, currently holding less than 420 rows of data.  When each row is databound, I'm doing a check on the server to figure out which CSS class to apply, along with the text and command argument of a button in the row.  We aren't using a pager since the dock itself will only show 4 or 5 rows of data at a time.

So here's the hitch.  In Firefox, Chrome and Safari, everything is smooth and quick.  In IE 8 (on a 32-bit Win7 machine, also what the vast majority of users will be using the application on), the page hangs and is very unresponsive; it takes about a minute to render the page even though loading the data is very quick.  There isn't much Javascript on the page (that control doesn't have any at the moment) and if I put a pager in there, it will load, yet still be slow.  I've isolated the other controls, and it's definitely the one with the RadGrid (we have one control with a RadScheduler and others have charts).  I've looked into optimizing it (we're already binding with a web service), yet I can't seem to figure out what else may be causing the grid's processor/memory hogging when loading in IE.  Is there anything else I can do to get the grid to behave properly in IE?
Vasil
Telerik team
 answered on 11 Jan 2013
9 answers
385 views
Hi,

I am also using a radeditor. And facing a problem coz of the <br>.
When I am removing whole text from radeditor and making it blank, still it shows presence of html text as <br>, <p>&nbsp;</p> and

sometimes <p><br></p>.

I have a required field validator for this radeditor. When I enter any text in radeditor, the error message for this required radeditor is

disappearing only after a post back. But it should disappear as soon as we type any text in radeditor.
So I wrote a javascript for firing onblur event and explicitly hiding the error message if radeditor's content is not null.

I am calling the function using "OnClienLoad" :
<telerik:RadEditor ID="ContractExpirationAlertEditor" runat="server" Skin="Gray" OnClientLoad="DisableRequiredMessage"
                                        ToolsFile="~/Contracting/ToolsFile.xml" Width="100%" ContentFilters="None" OnTextChanged="ContractExpirationAlertEditor_TextChanged">
                                        <CssFiles>
                                            <telerik:EditorCssFile Value="~/EditorContent.css" />
                                        </CssFiles>
</telerik:RadEditor>


Then in Javascript, function is like :
function DisableRequiredMessage(editor, args) {
var element = document.all ? editor.get_document().body : editor.get_document();
                $telerik.addExternalHandler(element, "blur", function(e) {
                    var editor1 = $find("ctl00_ContentPlaceHolder1_ContractExpirationAlertEditor");
                    var message1 = editor1.get_html();
if (message1 == '<br>' || message1 == '<p> </p>') {
                        alert(message1);
                        document.getElementById('ctl00_ContentPlaceHolder1_spnEmailBody').style.display = 'block';
                    }
                    else {
                        alert(message1);
                        document.getElementById('ctl00_ContentPlaceHolder1_spnEmailBody').style.display = 'none';
                    }
});
            }

I also tried to compare the length of the text in radeditor and hide and unhide the required error message :
var editor2 = $find("ctl00_ContentPlaceHolder1_ContractPendingEContractEditor");
                    var message2 = editor2.get_text();
if (message2.length > 1) {
                        //alert("Mozozozo" + message2.length);
                        document.getElementById('<%=spnContrPendngEmail.ClientID %>').style.display = 'none';
                    }
                    if (message2.length == 0 || message2.length == 1) {
                        //alert("Mozozozo");
                        document.getElementById('<%=spnContrPendngEmail.ClientID %>').style.display = 'block';
                    }
But it is not working in IE. When we type any text in radeditor ,I am able to hide the error message. But if we remove the text, we are
not getting the error message back. Thus required validation is not happening.

Please help me.

Thank You in advance.
Rumen
Telerik team
 answered on 11 Jan 2013
1 answer
59 views
Hi,
     How can I change the headertext of the boundcolumn in the code behind. Got any idea?? Pls help

thanks
Ryan
Shinu
Top achievements
Rank 2
 answered on 11 Jan 2013
9 answers
954 views

Hi all,

I wanna learn if it's possible to bind 2 database fields into 1 bound column ?

forexample I wanna bind QUANTITY,SELECTED_UNIT fields to 1 column..

<telerik:GridBoundColumn DataField='QUANTITY + SELECTED_UNIT' >

thanx in advance for solutions
Shivanshu
Top achievements
Rank 2
 answered on 11 Jan 2013
15 answers
763 views
My post is related to this one: http://www.telerik.com/community/forums/aspnet-ajax/window/migrating-from-modalpopupextender-to-radwindow.aspx

I'm trying to replace all instances of the Modal Popup Extender with RadWindow.  I've enclosed a screenshot example of one of them.  Simply put, I want to display a modal popup window and get the user to fill in a bunch of info.

Important Note: Several of the control changes will cause a postback BUT I only want a partial postback!  What's happening now is that every time I change the value of a control that has Autopostback="true" I get a full postback.  This is unacceptable.

Is what I'm looking to do even possible with the RadWindow?  If so, how?

Sincerely,

Robert W.
Marin Bratanov
Telerik team
 answered on 11 Jan 2013
8 answers
141 views
Hi,

    We are using telerik 2011.1.413.35. The content specified in RadEditor doesnt get saved in IE9 when compatibility mode is turned off. But it works fine when the compatiblity mode is turned on. And it works fine in all other browsers that includes firefox, chrome, safari, IE8.

    I have seen the workaround for this issue http://www.telerik.com/support/kb/aspnet-ajax/editor/radeditor-content-not-saved-after-ajax-update-in-firefox-google-chrome-and-safari.aspx. We use Image Button here.  But doing this workaround would result in lot of code changes in several places,

<asp:ImageButton OnClientClick="javascript:__doPostBack(this.id,'');return false;"
ID="ImageButton1" runat="server" OnClick="btnSave_Click"
ImageUrl="Save.gif" /> 

  So, is there any other way to solve the problem. Please guide me.


Thanks,
Hema.
Marcel Härry
Top achievements
Rank 1
 answered on 11 Jan 2013
1 answer
68 views
We have been waiting since June 2012 for Telerik to add font control (size, style, type etc) to the chart axis.
Q3 2012 did not introduce these features and we are left wondering what is going on?

Were are approaching project milestones and deliverables now that are causing us to consider alternative products as Telerik seem uninterested in implementing this basic functionality. Our product requires smaller more compact HTML5 charts. This is just not possible with the font limitations.

Come on Telerik.- when?
Danail Vasilev
Telerik team
 answered on 11 Jan 2013
1 answer
79 views
I am facing problem of user control not updated.

Problem Narration:
As per my and client's requirement:
I've created two user control.
One user control having a drop down.
Another user control having few no of controls and its event.
Both user control i've used in my one web page twice.
FilterDropDown and FilterDropDownGridContact is two user control.(having only a drop down)

For partial postback I've used following AjaxSettings.

<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
 runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnSave">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="FilterDropDown" />
<telerik:AjaxUpdatedControl ControlID="FilterDropDownGridContact" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1"  runat="server">
</telerik:RadAjaxLoadingPanel>

Below is code of user controls how i used in first place:
<UserControl:FilterDropDown ID="FilterDropDown" runat="server" GridID="gridLocation"
                                   EnableViewState="true" pageName="UserProfile" PlaceHolderID="ContentPlaceHolder1" />
 
<UserControl:Filter ID="Filter" runat="server" GridID="gridLocation" EnableViewState="true"
                                   PlaceHolderID="ContentPlaceHolder1" />
Below is code of user controls how i used in second time:
<UserControl:FilterDropDown ID="FilterDropDownGridContact" runat="server" GridID="gridClientContact"
                                   EnableViewState="true" pageName="ClientContact" PlaceHolderID="ContentPlaceHolder1" />
<UserControl:Filter ID="FilterGridContact" runat="server" GridID="gridClientContact" EnableViewState="true"
                                   PlaceHolderID="ContentPlaceHolder1" />
Below are the events attached in code behind:
protected void Page_Load(object sender, EventArgs e)
        {
                FilterDropDown.drpFilterChange += new EventHandler(drpFilter_SelectedIndexChange);
                Filter.SaveFilter += new EventHandler(SaveFilter); //attached with btnSave button
                Filter.ClearFilterSelection += new EventHandler(ClearFilterSelection);
                Filter.DeleteFilter += new EventHandler(DeleteFilter);
                FilterDropDownGridContact.drpFilterChange += new EventHandler(FilterDropDownGridContact_SelectedIndexChange);
                FilterGridContact.SaveFilter += new EventHandler(SaveContactFilter);//attached with btnSave button
                FilterGridContact.ClearFilterSelection += new EventHandler(ClearContactFilterSelection);
                FilterGridContact.DeleteFilter += new EventHandler(DeleteContactFilter);
               //Other stuffs
}
When I debug my projects, all custom events fires and get updated data in code behind and in database too.
But it display old(Not updated) data on web page or drop down.

e.g.
Now when I click on btnSave of first user control event fires and as per ajax setting dropdown user control updates.

But, when I click on btnSave of second user control events fires but user control is not updated.
 
So, Whats issue??
 
Is there any way, so that i can update ajax setting such as update first user control when respective user control's btnSave fires and so on.

Kostadin
Telerik team
 answered on 11 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?