Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
152 views
Dear All,


In my grid I have a NestedViewTemplate, which has a <asp:Panel />. I create my own expand/collapse template in this panel. Using the structure below. I am able to get access to the .text of my textbox in the template (in _Itemcommand), but the dropdownlist is always empty, and selectedvalue is nothing.

I use rgDefects_ItemCommand to fill all my textboxes and dropdowns and datepickers etc.. with the values required for the row. This all works fine. Then I have a button with a CommandName of "SaveDefect" which then also uses rgDefects_ItemCommand to read out the values. It's very strange that some controls work as expected but others don't (dropdownlists).

Any ideas?

Thanks in advance!!


My structure is basically:

 <telerik:RadGrid ID="rgDefects" runat="server" Skin="Vista" AutoGenerateColumns="false" Width="99%"  >
                 <MasterTableView DataKeyNames="DID" AllowMultiColumnSorting="True"  HierarchyLoadMode="ServerOnDemand" GroupLoadMode="Server">
                    <NestedViewTemplate>
                    <asp:Panel runat="server" ID="InnerContainer" Visible="true">
                            
                            <asp:TextBox ID="txtDescription"  runat="server" class="text-input large-input" TabIndex="1" />
                           <asp:DropDownList ID="ddlTrades" runat="server"  class="large-input" TabIndex="2" />
                   </asp:Panel>
                   </NestedViewTemplate>

                  <Columns>
                       <!-- My normal grid here. -->
                 </Columns>

                    </MasterTableView>
                </telerik:RadGrid>


My VB:

Private Sub rgDefects_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgDefects.ItemCommand

If e.CommandName = RadGrid.ExpandCollapseCommandName Then
            Dim item As GridDataItem = TryCast(e.Item, GridDataItem)

            If Not item.Expanded Then
                Dim nestedItem As GridNestedViewItem = DirectCast(item.ChildItem, GridNestedViewItem)
                Dim dataKeyValue As String = Convert.ToString(DirectCast((nestedItem.ParentItem), GridDataItem).GetDataKeyValue("DID"))

                Dim txtDescription As TextBox
                txtDescription = DirectCast(nestedItem.FindControl("txtDescription"), TextBox)
                txtDescription.text = "Test txtDescription!"

                Dim ddlTrades As DropDownList
                ddlTrades = DirectCast(nestedItem.FindControl("ddlTrades"), DropDownList)
                ddlTrades.Items.Add(New Listitem("Test1","1"))
                ddlTrades.Items.Add(New Listitem("Test2","2"))


          ElseIf e.CommandName = "SaveDefect" Then
            Dim item As GridNestedViewItem = TryCast(e.Item, GridNestedViewItem)
            Dim dataKeyValue As String = Convert.ToString(DirectCast(item.ParentItem, GridDataItem).GetDataKeyValue("DID"))

            
            Dim txtDescription As TextBox
            txtDescription = DirectCast(item.FindControl("txtDescription"), TextBox)

            Dim ddlTrades As DropDownList
            ddlTrades = DirectCast(item.FindControl("ddlTrades"), DropDownList)
            Dim t As Integer = ddlTrades.SelectedValue

End If


Mira
Telerik team
 answered on 19 Aug 2010
3 answers
306 views
Dears,
Is it possible in RadGrid to have column with Auto Fill mode (The column size will be the size of the grid - the sum of other columns sizes). So, this column will occupy all the empty space in the grid.
I tried the following way, I did not set size of one of RadGrid columns and that worked perfectly, that column ocuppied all empty space in the grid. but this way did not work with all internet explorers and not with all screens resultions, So, is there any more professional way?

Thanks in Advance
Best Regards
Dimo
Telerik team
 answered on 19 Aug 2010
1 answer
96 views
When we use RADEditor and jQuery on the same page, IE 6/7/8 throw a script error during page unload.
We use $telerik.addExternalHandler and editor.attachEventHandler. No jQuery event handlers are used.

This is version 2010.1.519.35 of Telerik.Web.UI.

The exception is:
Error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: element

The JScript call stack:
JScript anonymous function
JScript anonymous function
Sys$Application$_unloadHandler
Sys$Application$Dispose
JScript anonymous function
JScript anonymous function
Sys$Ui$DomEvent$removeHandler

The inner most anonymous function is from Telerik.Web.UI.Editor.RadEditor.js, and the call to removeHandler is from this code:
},_registerModeChangeHandler:function(c){if(c){this._onModeButtonClickDelegate=Function.createDelegate(this,this._onModeButtonClick);
$addHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
}else{if(this._onModeButtonClickDelegate){$removeHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
this._onModeButtonClickDelegate=null;
}}},_onModeButtonClick:function(h){var g=this.get_mode();


A workaround is to add the following as the last script on the page:

<!--[if IE]>
<script type="text/javascript">
    (function() {
        var remove = window.$removeHandler;
        window.$removeHandler = function(a,b,c) {
            if (a) {
                remove(a,b,c);
            }
        }
    })();
</script>
<![endif]-->
Fiko
Telerik team
 answered on 19 Aug 2010
1 answer
137 views
Hello,
Is it possible to create a skin for a tabstrip with different styling on multiple levels of tabs?

Thanks,
Bob 
Kamen Bundev
Telerik team
 answered on 19 Aug 2010
3 answers
203 views
Hi:

How can I reload the radpane content serverside?

I have this
<telerik:RadPane ID="sp1Restricted01" runat="server" Width="100%" Height="100%" ContentUrl="ePageBase01.aspx?a=1"
            </telerik:RadPane> 
        </telerik:RadSplitter> 

Using a combobox I load the content of the RadPane with:

ePageBase01.aspx?a=2
ePageBase01.aspx?a=3

Does it exist a form I can reload the RadPane content serverside, so I can reload the same content. So If I have ePageBase01.aspx?a=2 in the contenturl value, I need to reload the same value of contenturl, ePageBase01.aspx?a=2
Tsvetie
Telerik team
 answered on 19 Aug 2010
1 answer
106 views
Just a quick question - when the user clicks the expand button on a row, what event can I use to replace a foreign numeric key from the database used by the grid with a value drawn from a different database (hence I cannot simply do a join)?

Note that I have tried the Item command event - but at that point the data in the nested view is not yet bound - so the foreign key is not there yet... if it is just the ItemDataBound event - then how do I differentiate its data binding from the data binding of all the other elements of the grid?

Thanks
Chris
Daniel
Telerik team
 answered on 19 Aug 2010
1 answer
106 views
Is there a way to disable the behavior of restoring the scroll position on the completion of an Ajax call?
Maria Ilieva
Telerik team
 answered on 19 Aug 2010
3 answers
365 views
Hello,

I am working on RadGrid. I need help regarding insert new row in a Rad grid.
I know how to insert a new row in rad grid.but I don't want like this. When i press 'add new row' button it just open new dialog inside grid.
Basically i want to insert inline row instead of dialog for entering data. Please guide me how can i enter data in new row using inline.

I hope you understand my question. I don't want to open any dialog. I just want to use radgrid same lik Microsoft excel for entering data.


Regards
Mohsin JK 
Iana Tsolova
Telerik team
 answered on 19 Aug 2010
1 answer
74 views
Hello

I am using RadGrid in my application to insert and updated a record. I am using Master page in my application.

depending upon the querystring i an setting the mode of RadGrid. for example if i get a querystring i am setting the RadGrid in edit mode if not then in insert mode.

If it is in Insert mode and once the record is inserted, I will show a RAD alert message to user and then it will change it into edit mode for the inserted record.

If i try to change any data again and save the record back it gives an error "Object undefined”. I debugged this bug and found the cause for this problem.

It looks like after the post back the ID's of controls are getting changed and the javascript in WebResource.axd still referring with old IDS.WebResource.axd and JavaScript are not getting updated with the new IDs

For example, before Insert JavaScript trying to get the object using J-Query with the object ID as

 “ctl00_ContentPlaceHolder1_RadGridAccManageMain_ctl00_ctl02_ctl01_txtBoxCompanyName”

 

But after the Insert the client ID got changed to

 

“ctl00_ContentPlaceHolder1_RadGridAccManageMain_ctl00_ctl05_txtBoxCompanyName”

 

But the generated JavaScript in “WebResource.axd” still referring the object with old ID and it is causing JavaScript undefined error.

How do I resolve this issue?

Veli
Telerik team
 answered on 19 Aug 2010
1 answer
142 views
I've seen this topic raised a couple times in various ways but the solution never seems to relate to what I'm doing. I have a simple master page and content pages.  The menu is in the master page.  The OnItemCreated event is registered and there is a handler in the master page code behind.  The event doesn't fire.  The overall goal is to have the menu on the master page drive the pages that get loaded for content, as well as having some of the pages determine which menu options are available depending on login status and other factors.

I want ItemCreated to fire because I have NavigateURL set in the markup and want to use the technique of moving those properties into Attributes (at ItemCreated time) so that other events fire and I can manage what happens at runtime.  Is there a better place to do this?  Note that I'm not binding to a data source for the menu data - everything is hardcoded for now.

(Blowing some steam here)

Why can't controls just fire and properties just hold data?  Why is it that "this event doesn't fire when that property is set" or "that event doesn't fire when the control is on this kind of page" or "move the property to an attribute if you want it to do this"?  Clients are asking me why it takes a couple hours to just get something to click on a page when to them "it's just a button".  It's because every control I touch has its own personality, its own set of undocumented rules, its own forums to search through.  This is exactly why anti-Microsoft antagonists say ASP.NET takes hours to write something that takes minutes elsewhere.  My response to that is to simply look at the functionality you don't get outside of ASP.NET, and to look at all of the scripting and CSS and code you need to write, even with jQuery or similar libraries, just to get close what's built-in to ASP.NET and Telerik controls.  After all of the chest-thumping on both sides, the net result is still that we have to go through contortions just to make simple things happen on a screen.

It would be great to see documentation on why things don't work with these controls, as well as how to make them work - an organized collection of the answers we see in these forums every day.  That would save hours of research every week, if not every day.

OK, I'm done.  Thank you for your indulgence.  ;)
Veronica
Telerik team
 answered on 19 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?