Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
699 views
I have a grid column of button type:
<telerik:GridButtonColumn ButtonType=ImageButton ImageUrl="images/Img_Del.gif"></telerik:GridButtonColumn> 

I want to tie the button click to a javascript function. Is this possible?
I want to do an AJAX call from this function to perform the delete operation and refresh the grid.

 


Appreciate a reply.

thanks

 

Shinu
Top achievements
Rank 2
 answered on 27 Aug 2010
1 answer
179 views
Hi

I have a column containing a hashed password, and when the grid is in edit mode,
with the edit form displayed, I don't want the hashed form to appear, just a blank textbox.

I haven't been able to find the right event/method to clear the current content from the
textbox in the edit form, while allowing the new content that is typed in to be bound when
the update takes place.

The column is already a template column.
I am using Q2 2009 on this particular site.

Can you help? (VB preferred)

Thanks

Clive

Princy
Top achievements
Rank 2
 answered on 27 Aug 2010
1 answer
65 views
I'm constructing a User Control called "Hierarchy" inside of which is just one control, a RadTreeView.  I load it dynamically and then populate it forthwith.  All of that works fine.

With this treeview on the bottom-most nodes have any meaning with a Click event.

What's not working is that if the user clicks a non-bottom node (ie. a branch) then sometimes the treeview remains in the state that it is (good) but other times unexpected things happen with some/all of the branches closing.  I'm not sure why this phenomenon is occurring and how I can correct it.  Any advice would be much appreciated!

Robert

P.S. An alternative solution would be for me to simply disable the server-side click events of all the branch nodes and only have the click events enabled for the bottom-most nodes.  But I don't know if this is even possible or how to do it.
Robert
Top achievements
Rank 1
 answered on 27 Aug 2010
6 answers
199 views
Here is my grid:

<

 

telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"

 

 

 

 

Height="100px" Width="600px" >

 

 

 

<MasterTableView AutoGenerateColumns="false" >

 

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="ContactName" DataType="System.String"

 

 

HeaderText="Contact Name" ReadOnly="True"

 

 

>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Title" DataType="System.String"

 

 

HeaderText="Title" ReadOnly="True"

 

 

>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Email" DataType="System.String"

 

 

HeaderText="Email" ReadOnly="True"

 

 

>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Phone" DataType="System.String"

 

 

HeaderText="Phone" ReadOnly="True"

 

 

>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Fax" DataType="System.String"

 

 

HeaderText="Fax" ReadOnly="True"

 

 

>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ContactType" DataType="System.String"

 

 

HeaderText="Contact Type" ReadOnly="True"

 

 

>

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

 

 

 

</td>

 

 

</tr>

 

 

</table>

 


Here is the click event:

 

protected void btnRecord_Click(object sender, EventArgs e)

 

{

RadGrid1.DataSource =

null;

 

RadGrid1.Rebind();

 

}


and down below is the needdatasource method:

protected

 

void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)

 

{

 

Contact curContact = new Contact();

 

curContact.ContactName = TextBox1.Text;

curContact.Title = TextBox2.Text;

curContact.Email = TextBox3.Text;

curContact.Phone = TextBox4.Text;

curContact.Fax = TextBox5.Text;

 

if (Session["ContactType"] != null)

 

{

curContact.ContactType = Session[

"ContactType"].ToString();

 

}

 

 

DataTable dt = new DataTable();

 

dt.Columns.Add(

"ContactName");

 

dt.Columns.Add(

"Title");

 

dt.Columns.Add(

"Email");

 

dt.Columns.Add(

"Phone");

 

dt.Columns.Add(

"Fax");

 

dt.Columns.Add(

"ContactType");

 

dt.Rows.Add(curContact.ContactName, curContact.Title, curContact.Email, curContact.Phone, curContact.Fax,

curContact.ContactType);

RadGrid1.DataSource = dt;

}


The binding occurs and populates the grid when the page loads for the first time. But in the button click event the rebind forces the needdatasource event to fire but does not do any binding with the new passed values.

Please help. Thanks.
Shamim
Top achievements
Rank 1
 answered on 27 Aug 2010
1 answer
101 views

Hi all,

I have a grid within an radajaxpanel and I'm looking to update a control in one itemtemplate when a control within another itemtemplate performs a post back (dropdownlist, radiobuttonlist, etc) for that row.

This is not for insert or updating, i'm using the grid for proper formatting. So my question is what event is raised when a control posts back within an item template, and how can I find the control within that row? I've tried adding a handler to the control but it does not fire when the control is within the itemtempate.

Thanks,

John
Mooka
Top achievements
Rank 1
 answered on 26 Aug 2010
7 answers
178 views
Greetings,

   I am curious as to what I should expect the behavior to be of a page which utilizes a RadAjaxPanel and functions correctly on the dev box (ASP.NET Development Server, VS 2008 .NET 3.5) but it is subsequently deployed to a server that does not have Ajax (AjaxControlTookit etc.) installed or configured properly. Ex. tell would be AjaxControlToolkit.dll not in bin.

   As far as I can tell the ajax simply does not work, but the app continues to work correctly as if the ajax panel(s) had never been. Does this make sense? We are using Q3 2009 wihtout SP1 or SP2. This question is specific to RadAjaxPanel, but also could be 100% the same answer behavior as the out of the box UpdatePanel etc. Unfortunately in my build for the day on the server I only have the one spot where postback is not async like I expect it to be (and it is on my localhost). So I can't go check a second page for the same behavior.

   On localhost I can see the post data has __ASYNCPOST true, and the param is missing for the autopostback request on the server implicating the default of false. Also RadAJAXControlID parameter is missing in post (for just the real server).

Thank-You,
   Justin
Donna
Top achievements
Rank 1
 answered on 26 Aug 2010
8 answers
287 views
I have a setup where I have a masterpage with a codebehind. I have another page that is a web file with a user control + codebehind that uses the master page. On the masterpage I have a RadAjaxManager that I am creating dynamically in the PageInit and adding to a placeholder on the masterpage:

RadAjaxManager RadAjaxManagerMaster = new RadAjaxManager();
RadAjaxManagerMaster.ID =
"RadAjaxManagerMaster";

AjaxSetting RadAjaxManagerMasterAjaxSettings =
new AjaxSetting();

RadAjaxManagerMasterAjaxSettings.AjaxControlID =
"RadContextMenuMaster"; 

                AjaxUpdatedControl RadWindowAjaxControl = new AjaxUpdatedControl(); 
                RadWindowAjaxControl.ControlID = "RadWindowMaster";
 
                AjaxUpdatedControl RadContextMenuAjaxControl = new AjaxUpdatedControl(); 
                RadContextMenuAjaxControl.ControlID = "RadContextMenuMaster";
 
                RadAjaxManagerMasterAjaxSettings.UpdatedControls.Add(RadWindowAjaxControl); 
                RadAjaxManagerMasterAjaxSettings.UpdatedControls.Add(RadContextMenuAjaxControl); 
                RadAjaxManagerMaster.AjaxSettings.Add(RadAjaxManagerMasterAjaxSettings); 
 
                RadAjaxLoadingPanel RadAjaxLoadingPanelMaster = new RadAjaxLoadingPanel(); 
                RadAjaxLoadingPanelMaster.ID = "RadAjaxLoadingPanelMaster";
                RadAjaxLoadingPanelMaster.BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center;
 
                PlaceHolder PlaceHolderCMSAdmin = (PlaceHolder)Shuware.ShuwareCommon.Web.FindControlByID(this.Controls, "PlaceHolderCMSAdmin");
                if (PlaceHolderCMSAdmin != null)
                {
                    PlaceHolderCMSAdmin.Controls.Add(RadAjaxManagerMaster);
                    PlaceHolderCMSAdmin.Controls.Add(RadAjaxLoadingPanelMaster);
                }

Yet when I run the page none of the ajax works at all. I read in another thread that you should create the radajaxmanager in the PageInit and the updated controls in the PageLoad, I tried this as well to no avail. This is inside the PageLoad:

private void CreateAjaxSettings()
    {
        RadAjaxManagerProxy RadAjaxManagerProxy = (RadAjaxManagerProxy)Shuware.ShuwareCommon.Web.FindControlByID(this.Controls, "RadAjaxManagerProxy");
 
        AjaxSetting RadAjaxManagerProxyAjaxSettings = new AjaxSetting();
        RadAjaxManagerProxyAjaxSettings.AjaxControlID = "RadContextMenuMaster";
 
        AjaxUpdatedControl divCMSContentAjaxControl = new AjaxUpdatedControl();
        divCMSContentAjaxControl.ControlID = "divCMSContent";
        divCMSContentAjaxControl.LoadingPanelID = "radAjaxLoadingPanel";
 
        AjaxUpdatedControl RadPlaceholderAjaxControl = new AjaxUpdatedControl();
        RadPlaceholderAjaxControl.ControlID = "PlaceHolderContentCMS";
 
        AjaxUpdatedControl LabelDebugAjaxControl = new AjaxUpdatedControl();
        LabelDebugAjaxControl.ControlID = "LabelDebug";
 
        AjaxUpdatedControl RadWindowAjaxControl = new AjaxUpdatedControl();
        RadWindowAjaxControl.ControlID = "RadWindowMaster";
 
        AjaxUpdatedControl RadContextMenuAjaxControl = new AjaxUpdatedControl();
        RadContextMenuAjaxControl.ControlID = "RadContextMenuCMS";
 
        RadAjaxManagerProxyAjaxSettings.UpdatedControls.Add(divCMSContentAjaxControl);
        RadAjaxManagerProxyAjaxSettings.UpdatedControls.Add(RadPlaceholderAjaxControl);
        RadAjaxManagerProxyAjaxSettings.UpdatedControls.Add(LabelDebugAjaxControl);
        RadAjaxManagerProxyAjaxSettings.UpdatedControls.Add(RadWindowAjaxControl);
        RadAjaxManagerProxyAjaxSettings.UpdatedControls.Add(RadContextMenuAjaxControl);
        RadAjaxManagerProxy.AjaxSettings.Add(RadAjaxManagerProxyAjaxSettings);
    }

And this is in the PageInit: (using a proxy because I have a RadAjaxManager on the masterpage for this file)

            RadAjaxManagerProxy RadAjaxManagerProxy = new RadAjaxManagerProxy();
            RadAjaxManagerProxy.ID = "RadAjaxManagerProxy";
 
            PlaceHolder PlaceHolderCMSAdmin = (PlaceHolder)Shuware.ShuwareCommon.Web.FindControlByID(this.Controls, "PlaceHolderCMSAdmin");
            if (PlaceHolderCMSAdmin != null)
            {
                PlaceHolderCMSAdmin.Controls.Add(RadAjaxManagerProxy);
            }

In both these instances absolutely no ajax works on the page. I used to have these controls on the actual page not in the codebehind and everything worked perfectly.
Dan Miller
Top achievements
Rank 1
 answered on 26 Aug 2010
1 answer
348 views
I have a set of 2 tables I am trying to display in a hierarchical grid. 

Table 1 is a list of State Licenses.  A rep has an identifying "ProducerNumber" and then a "State", which can appear more than once in the table, plus some other details.

Table 2 is a list of State details.  It has the same "ProducerNumber", "State", and then the "Details" line. 

So in my table I want the top level grid to be the list of States, and once a state is expanded the Details lines for that state will be displayed underneath.  The details lines need to match on 3 qualties: "ProducerNumber", "State", and "Class" to be unique.

I've tried setting my table up as per the sample at: http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarativerelations/defaultvb.aspx but I only ever get any details for the top level display.  If I click to expand any of the states it's simply blank.

Can anyone help?  Are there more examples of how to set this up?  Do you need to see my code?
Kevin
Top achievements
Rank 1
 answered on 26 Aug 2010
4 answers
162 views

When I push the next page plik on a RadGrid the NeedDataSource event fires.  How do I get the grid to handle paging without hitting the database each time?

<telerik:RadGrid 
        ID="RadGrid1" 
        runat="server" 
        Width="100%" 
        Height="100%" 
        GridLines="None"
        AutoGenerateColumns="False" 
        AllowSorting="True"
        AllowFilteringByColumn="True" 
        SelectedItemStyle-BackColor="LightBlue" AllowPaging="True" 
        onneeddatasource="RadGrid1_NeedDataSource" PageSize="100">
Michael
Top achievements
Rank 1
 answered on 26 Aug 2010
2 answers
120 views
Greetings All,

I am trying to create a MDI (Multiple Document Interface) within an ASP.NET AJAX application using RadMenu and RadWindowManager. I couldn't find anything concerning this topic and wanted to reach out to the community. I have two questions..

1) Is there any documentation about how to achieve this using RadMenu and RadWindowManager? I wasn't able to find any, but don't want to re-invent the wheel if possible.

2) Are there any major flaws with this approach?
            (1) Upon creation of a RadWindow...
                     add a RadMenuItem to the "Window" RadMenuItem using insert() method.
                     mark the item's state as checked.
                     mark all other item's state as unchecked.
            2) Upon selection of a window's RadMenuItem...
                    get the corresponding RadWindow and call window.setActive() on the given window. 
                    mark the item's state as checked.            
                    mark all other item's state as unchecked.
            3) On window closing...
                     remove the RadMenuItem for the window using remove() method.
                     
Any feedback is much appreciated.

Regards,
Tom
                
    
Tom M
Top achievements
Rank 1
 answered on 26 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?