Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
191 views
C#, web part for MOSS 2007:

Have my RadGrid defined and populated in the CreateChildControls() method.  I am trying to use the ItemCommand event handler with limited success.

When I debug, the following events are not fired and caught in my ItemCommand() event handler method:

PerformInsertCommand
UpdateCommandName

Meanwhile, the following events are fired and caught in my ItemCommand() event handler method:

InitInsertCommandName
EditCommandName

It seems as though the "pre" action events are firing, but not the "post" action events.

Any ideas?
Vlad
Telerik team
 answered on 21 Apr 2008
2 answers
244 views
I would like to use the EnableLoadOnDemand feature of the RadComboBox.  I have it working now but would like to use an ItemTemplate also and can't seem to figure out how to get it to work.

Here is the template:
<telerik:RadComboBox ID="ddlActivity2" runat="server" Skin="DWDS" EnableEmbeddedSkins="false" MarkFirstMatch="true" Width="728px"   
                                 Height="320px" ShowMoreResultsBox="true" EnableLoadOnDemand="true" OnItemsRequested="ddlActivity2_ItemsRequested" EnableVirtualScrolling="true" ShowToggleImage="true" 
                                  DataTextField=Name_Partner  
                                HighlightTemplatedItems="true"  
                                DataValueField=Activity_ID 
                                > 
                                <HeaderTemplate> 
                                    <table style="text-align:left; width:728px;"> 
                                        <tr> 
                                            <td style="text-align:left; width: 250px;">Activity</td> 
                                            <td style="text-align:left; width: 250px">Partner</td> 
                                            <td style="text-align:left; width: 228px">Category</td> 
                                        </tr> 
                                    </table> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    <table style="text-align:left; width:728px"> 
                                        <tr> 
                                            <td style="text-align:left; width: 250px;"><%# DataBinder.Eval(Container, "Attributes['Name']")%></td> 
                                            <td style="text-align:left; width: 250px"><%# DataBinder.Eval(Container, "Attributes['PName']") %></td> 
                                            <td style="text-align:left; width: 228px"><%# DataBinder.Eval(Container, "Attributes['Category_Name']")%></td> 
                                        </tr> 
                                    </table> 
                                </ItemTemplate> 
                            </telerik:RadComboBox> 

Here is the code behind:
protected void ddlActivity2_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) 
        { 
            DataTable data = new DataTable(); 
            SqlConnection myCN = new SqlConnection(ConfigurationManager.ConnectionStrings["oConnCF"].ConnectionString); 
            SqlCommand myCom = new SqlCommand(); 
            myCom = new SqlCommand("Activity_ByGrant_ByPartner_Ajax", myCN); 
            SqlDataAdapter da = new SqlDataAdapter(myCom); 
 
            myCom.CommandType = CommandType.StoredProcedure; 
            myCom.Parameters.Add("@filter", SqlDbType.Text).Value = e.Text; 
            if (uInfo.Access >= 30) 
            { 
                myCom.Parameters.Add("@gid", SqlDbType.Int).Value = _grantID; 
                myCom.Parameters.Add("@pid", SqlDbType.Int).Value = 0; 
            } 
            else 
            { 
                myCom.Parameters.Add("@gid", SqlDbType.Int).Value = _grantID; 
                myCom.Parameters.Add("@pid", SqlDbType.Int).Value = uInfo.PartnerID; 
            } 
 
             
                DataSet ds = new DataSet(); 
                da.Fill(ds,"Events"); 
                data = ds.Tables["Events"]; 
         
             
            try 
            { 
 
                int itemsPerRequest = 10; 
                int itemOffset = e.NumberOfItems; 
                int endOffset = itemOffset + itemsPerRequest; 
                if (endOffset > data.Rows.Count) 
                { 
                    endOffset = data.Rows.Count; 
                } 
                if (endOffset == data.Rows.Count) 
                { 
                    e.EndOfItems = true; 
                } 
                else 
                { 
                    e.EndOfItems = false; 
                } 
                for (int i = itemOffset; i < endOffset; i++) 
                { 
                    RadComboBoxItem item = new RadComboBoxItem(data.Rows[i]["Name"].ToString(), data.Rows[i]["Activity_ID"].ToString()); 
                    item.Attributes.Add("Name", data.Rows[i]["Name"].ToString()); 
                    item.Attributes.Add("PName", data.Rows[i]["PName"].ToString()); 
                    item.Attributes.Add("Category_Name", data.Rows[i]["Category_Name"].ToString()); 
 
                    ddlActivity2.Items.Add(item); 
                } 
 
                if (data.Rows.Count > 0) 
                { 
                    e.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString()); 
                } 
                else 
                { 
                    e.Message = "No matches"; 
                } 
            } 
            catch 
            { 
                e.Message = "No matches"; 
            } 
        } 
As you can see I have been trying several different approaches (this happens to be where I finally gave up).

Any suggestions would be appreciated.

Thanks





Curt
Top achievements
Rank 1
 answered on 21 Apr 2008
0 answers
137 views
I would like to add timer to FileBrowser, what I did is

1. add Timer from AJax Extension,
2. Add Label 

<div class="leftPaneHeader">

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div>


3. add Timer_Tick like the follower
 

protected void Timer1_Tick(object sender, EventArgs e)

{

RadTreeView1.Nodes.Clear();

LoadTreeView(Server.MapPath(

"~/"));

Label1.Text =

"Updated at " + DateTime.Now.ToLongTimeString();

}

the Timer works, but it refresh the whole page,  my questions are:
 how to use timer to update page (which are only treeview and gridview )partially? how to keep the node expand and selected after user made a expansion and selection when update page partial?
 

Zhengmao
Top achievements
Rank 1
 asked on 21 Apr 2008
1 answer
113 views
Is is possible to trap and handle the click of a button in a GridButtonColumn on the client (cancelling the postback because I don't need the server to do anything)? 

Or, as an alternative, should I just use a template column and load it with a simple html image where the onclick is loaded with a call to my javascript functions in the page?  All I plan to do is open a RadWindow with additional information on the item clicked.  I thought the GridButtonColumn would be convenient to use, but I don't need to do anything in a server postback.


Regards,
Bob Reader
Sebastian
Telerik team
 answered on 21 Apr 2008
0 answers
369 views
Important information
In RadControls for ASP.NET AJAX Q1 2008 there is a change in the Client-Side API. The compatibility layer which was used in the transition beta period is now removed. All client-side methods strictly follow the ASP.NET AJAX conventions and are lower case.
For instance: get_collapsed() should always be used from now on, get_Collapsed() is no longer supported. This also results in significant improvement in page loading times.
Please, refer to the Client-Side Programming section in the online documantation of RadControls for ASP.NET AJAX for more details.

Best regards,
The Telerik team

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 21 Apr 2008
1 answer
492 views
Hello,

I passed like the last 4 hours trying to find a bug in my asp.net application which usie RadAjaxManager. Each time I used the RadScriptManager in my project I faced javascript errors like : "AjaxControlToolkit undefined" or "Telerik undefined".

I look all the documentation related to RadScriptManager, I saw that I needed a line in my web.config like :

<httpHandlers> 
      ...  
      Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"  
              validate="false" /> 
    </httpHandlers> 

but SOMETHING IS MISSING IN YOUR DOCUMENTATION, I found it, I'm so happy :).

The problem is that I have Vista which has IIS7. The configuration in II7 has changed.. the configuration of the web server related to your application is also defined in the web.config now. So I had this line in my web.config and all function properly now :

    <system.webServer> 
        <handlers> 
            ...  
            <add name="Give_it_a_name" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" /> 
        </handlers> 

I hope this information can be useful to someone else!!

Cedric
Erjan Gavalji
Telerik team
 answered on 21 Apr 2008
3 answers
221 views
Hi,

Please help me with the following issue:

I construct my entire treeview dynamically using code. However when I uncheck a parent node and click a button to cause a postback, all child nodes of that parent also get unchecked. I want to avoid this behaviour. Please let me know how to fix this.

Also, please note that I am taking care of only constructing my treeview when Page.IsPostBack = false. Also the EnableViewState property of my treeview is set to true.

Thanks,
Raj
Nikolay
Telerik team
 answered on 21 Apr 2008
3 answers
112 views
Hi,
I try to record a web test case where some requests are launched by RadAjaxManager, founding no form-post parameters are recorded.
Could I do some tricks to tweak this issue?

Regards,
Ricky.
Konstantin Petkov
Telerik team
 answered on 21 Apr 2008
1 answer
102 views
The documentation for Prometheus 2008 Q1 seems to indicate that the RadScriptBlock or RadCodeBlock is still part of the distribution, but I am unable to find the dll or namespace where it exists.

Can anyone point me in the right direction, or has it been eliminated?
Vlad
Telerik team
 answered on 21 Apr 2008
1 answer
87 views
Hello,
I have I grid row in edit mode with:
text box - user enters the amount,
drop down list - used to select a quantity,
a column called Total which is not editable,
a label in the command item template called  Amount Sum.
When the user selects the drop down list the qty changes and i have to calculate the total amount (qty * amount) and to update Total column and Amount Sum label which is the sum of all Total columns. All client side.
Can anybody give me an example how to do this?
Sebastian
Telerik team
 answered on 21 Apr 2008
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?