Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
380 views
I have a UserControl that implements IPostBackEventHandler and I have several problems:

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
    if (eventArgument.Equals("Refresh", StringComparison.InvariantCultureIgnoreCase))
        Refresh();
}

1) RadAjaxManager Property Builder does not list my control. I must add it manually in the Page_Load event.
2) When I initiate an ajax postback in javascript with the following code it does a normal postback (not ajax postback):
<%= Page.GetPostBackEventReference(FormView.FindControl("anotaciones"), "Refresh") %>

I solved the problem with two "not elegant" solutions:

1) By ajaxfing the whole FormView (totally inefficient!)
2) Or by putting the usercontrol in a RadAjaxPanel and then implementing the Ajax_Request event:
((sender as Control).FindControl("anotaciones") as Anotaciones).Refresh();

Is this a common practice? Or should RadAjaxManager work?
Thanks a lot!
Maria Ilieva
Telerik team
 answered on 27 Jun 2011
3 answers
64 views
Hello,
here is my sample code,

DataTable

 

 

dt = new DataTable();

 

dt.Columns.Add(

 

"Programs");

 

dt.Columns.Add(

 

"Values");

 

 

dt.Rows.Add(dt.NewRow());

dt.Rows[0][

 

"Programs"] = "ABC";

 

dt.Rows[0][

 

"Values"] = "10";

 

dt.Rows.Add(dt.NewRow());

dt.Rows[1][

 

"Programs"] = "DEF";

 

dt.Rows[1][

 

"Values"] = "20";

 

dt.Rows.Add(dt.NewRow());

dt.Rows[2][

 

"Programs"] = "GHI";

 

dt.Rows[2][

 

"Values"] = "30";

 

dt.Rows.Add(dt.NewRow());

dt.Rows[3][

 

"Programs"] = "JKL";

 

dt.Rows[3][

 

"Values"] = "40";

 

dt.Rows.Add(dt.NewRow());

dt.Rows[4][

 

"Programs"] = "MNO";

 

dt.Rows[4][

 

"Values"] = "50";

 

dt.Rows.Add(dt.NewRow());

dt.Rows[5][

 

"Programs"] = "PQR";

 

dt.Rows[5][

 

"Values"] = "60";

 

 

RadChart3.DataSource = dt;

RadChart3.DataBind();

for the above code I get the barchart, But I am not getting the Programs names like abc, def as axis lable value.

Instead of 1,2,3..6 I want abc, def etc. please someone help me.

Evgenia
Telerik team
 answered on 27 Jun 2011
3 answers
134 views
I have Telerik Premium Collection for .NET 2009 Q3. The subscription is expired on Jan 16, 2009. 

Currently I am using the VS 2005 professional version on a Windows 7 Home Premium 64 bit PC.  I am planning to upgrade the VS to VS2010 Professional.

However, I need to keep both version vs2005 and vs2010 at the same time.

May I know:
1. What is the best practice to install the Telerik controls?  I already install the Telerik controls for VS 2005.
2. Is it possible to run Dot Net FW 4.0 for VS 2010 and Dot Net FW 2.0 for VS 2005 at the same time?

Thanks.
Biliana Ficheva
Telerik team
 answered on 27 Jun 2011
1 answer
158 views
Hi!

When using FormDecorator on Fieldset the page render with different paddings for IE8 compared to Firefox and Crome.
Use this link: http://demos.telerik.com/aspnet-ajax/formdecorator/examples/default/defaultcs.aspx to see the difference att the top, "Decoration Zone".
Is there a fix for this? If I hit the compatibly button in IE8 it renders almost the same as in Firefox and Crome.

Sincerely, Thomas
Bozhidar
Telerik team
 answered on 27 Jun 2011
4 answers
144 views
Dear Support,

i have tried all samples below but i cannot make it work.
http://www.telerik.com/community/code-library/aspnet-ajax/grid/manual-insert-update-delete-using-formtemplate-and-sql-backend.aspx
http://www.telerik.com/community/code-library/aspnet-ajax/grid/manual-insert-update-delete-operations-using-auto-generated-editform-with-sql-statements-from-the-code-behind.aspx

I always get old values and not the new, when i update the record.

Can you please help me to find what i am doing wrong?

Also, how can i type default values (like date or password) in "Add New Record" fields (EditForms)
and how can i make some fields disable in "Add New Record" ?

Below you will find my code.

Thank you in advance for you time.

Best Regards,
George
Navarino Technology Department


<telerik:RadGrid ID="grdCustomers" runat="server" Height="600px" Skin="Windows7"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                    OnNeedDataSource="grdCustomers_NeedDataSource" OnDeleteCommand="grdCustomers_DeleteCommand"
                    OnInsertCommand="grdCustomers_InsertCommand" OnUpdateCommand="grdCustomers_UpdateCommand"
                    EnableAJAX="True">
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Windows7">
                    </HeaderContextMenu>
                    <MasterTableView DataKeyNames="ID" GridLines="None" Width="100%" CommandItemDisplay="Top">
                        <Columns>
                            <telerik:GridEditCommandColumn>
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn CommandName="Delete" ConfirmTitle="Delete" ConfirmDialogType="RadWindow"
                                ConfirmText="Delete this product?" Text="Delete" UniqueName="Delete">
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for employee with ID {0}"
                            CaptionDataField="ID">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />
                            <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"
                                Height="110px" Width="100%" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>
                            <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                        </EditFormSettings>
                        <ExpandCollapseColumn Visible="False">
                            <HeaderStyle Width="19px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                        <RowIndicatorColumn Visible="False">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                    </MasterTableView>
                    <ClientSettings>
                        <Scrolling AllowScroll="True" />
                    </ClientSettings>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>



Protected Sub grdCustomers_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles grdCustomers.NeedDataSource
 
    Try
        'Select Query to populate the RadGrid with data from table Employees.      
        Dim pCustomerID As New SqlClient.SqlParameter("@CustomerID", SqlDbType.NVarChar)
        pCustomerID.Value = cbCustomers.SelectedValue
 
        Dim tblResults As DataTable = ExecuteDataTable(ConnectionStrings.WebConnString, _
                                                       "spGetCustomersUsers", _
                                                       New Object() {pCustomerID})
        grdCustomers.DataSource = tblResults
    Catch ex As Exception
        grdCustomers.Controls.Add(New LiteralControl("Problem. Reason: " + ex.Message))
 
    End Try
 
 
End Sub
 
 
Protected Sub grdCustomers_UpdateCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
    'Get the GridEditableItem of the RadGrid      
    'Dim abc As String = e.Item.OwnerTableView.Columns.FindByDataField("ID").ToString()
    Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
    'Get the primary key value using the DataKeyValue.      
    'Access the textbox from the edit form template and store the values in string variables.      
 
    Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
    Dim newValues As New Hashtable()
    item.OwnerTableView.ExtractValuesFromItem(newValues, item)
 
    Try
 
        Dim pID As New SqlClient.SqlParameter("@ID", SqlDbType.Int)
        Dim pUserName As New SqlClient.SqlParameter("@UserName", SqlDbType.NVarChar)
        Dim pPassword As New SqlClient.SqlParameter("@Password", SqlDbType.NVarChar)
        Dim pUserFullName As New SqlClient.SqlParameter("@UserFullName", SqlDbType.NVarChar)
        Dim pRetries As New SqlClient.SqlParameter("@Retries", SqlDbType.Int)
        Dim pPhone As New SqlClient.SqlParameter("@Phone", SqlDbType.NVarChar)
        Dim pUserEmail As New SqlClient.SqlParameter("@UserEmail", SqlDbType.NVarChar)
        Dim pINVEmail As New SqlClient.SqlParameter("@INVEmail", SqlDbType.NVarChar)
        Dim pDNEmail As New SqlClient.SqlParameter("@DNEmail", SqlDbType.NVarChar)
        Dim pLockCCCOrder As New SqlClient.SqlParameter("@LockCCCOrder", SqlDbType.Bit)
        Dim pPowerUser As New SqlClient.SqlParameter("@PowerUser", SqlDbType.Bit)
        Dim pUserGroupID As New SqlClient.SqlParameter("@UserGroupID", SqlDbType.Int)
        Dim pInactive As New SqlClient.SqlParameter("@Inactive", SqlDbType.Bit)
 
        pID.Value = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("ID").ToString()
        pUserName.Value = (TryCast(editedItem("UserName").Controls(0), TextBox)).Text
        pPassword.Value = (TryCast(editedItem("Password").Controls(0), TextBox)).Text
        pUserFullName.Value = (TryCast(editedItem("UserFullName").Controls(0), TextBox)).Text
        pRetries.Value = newValues.Item("Retries").ToString
        pPhone.Value = (TryCast(editedItem("Phone").Controls(0), TextBox)).Text
        pUserEmail.Value = (TryCast(editedItem("UserEmail").Controls(0), TextBox)).Text
        pINVEmail.Value = (TryCast(editedItem("INVEmail").Controls(0), TextBox)).Text
        pDNEmail.Value = (TryCast(editedItem("DNEmail").Controls(0), TextBox)).Text
        pLockCCCOrder.Value = (TryCast(editedItem("LockCCCOrder").Controls(0), CheckBox)).Checked
        pPowerUser.Value = (TryCast(editedItem("PowerUser").Controls(0), CheckBox)).Checked
        pUserGroupID.Value = (TryCast(editedItem("UserGroupID").Controls(0), RadNumericTextBox)).Text
        pInactive.Value = (TryCast(editedItem("Inactive").Controls(0), CheckBox)).Checked
 
        ExecuteInsertSP(ConnectionStrings.WebConnString, _
                        "spUpdateWebUser", _
                        New Object() {pID, _
                                      pUserName, _
                                      pPassword, _
                                      pUserFullName, _
                                      pRetries, _
                                      pPhone, _
                                      pUserEmail, _
                                      pINVEmail, _
                                      pDNEmail, _
                                      pLockCCCOrder, _
                                      pPowerUser, _
                                      pUserGroupID, _
                                      pInactive})
 
    Catch ex As Exception
        grdCustomers.Controls.Add(New LiteralControl("Unable to update Employee. Reason: " + ex.Message))
        e.Canceled = True
    End Try
 
End Sub
Technology
Top achievements
Rank 1
 answered on 27 Jun 2011
2 answers
110 views

i have tool tip like that ,

http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=grid

Where i click grid tool tip will close . how i done this process
 

Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 27 Jun 2011
4 answers
164 views
Please I am developing an application which needs to handle RadListview transfers to and fro an access database. 
That means the select, insert, update and delete operations should be working on required transfer operations.
 But I am seeking a way to do this from code behind file.
  I will appreciate any help on this

Francis
Francis Frank
Top achievements
Rank 1
 answered on 27 Jun 2011
5 answers
158 views
Is it possible to define the day number into a CalendarDayTemplate? I cannot find anything in the docs to advise me. Thanks.
Maria Ilieva
Telerik team
 answered on 27 Jun 2011
1 answer
138 views

I have a RadGrid with two GridTemplateColumn columns, each of which contains a RadcomboBox  within the EditItemTemplate.

I am trying to configure page method-based auto-complete for each combobox.  The first will contain two items (say, "Colors" and "Numbers") and the second will ask a page method for a list of items that are relevant for what was selected in the first combobox; e.g., if the user selects "Colors" from the first combobox, he may only select a color from the second combobox.  Likewise, if he instead selects "Numbers" from the first list, he can only select numbers from the second list.  The page method used by the second combobox takes a parameter which is the value of the selection from the first combobox.

For the second combobox, I am attempting to use the ClientItemsRequesting event handler to set the value of the parameter to the page method a la http://trappedinhoth.blogspot.com/2008/05/telerik-radcombobox-auto-complete.html.
 
The ClientItemsRequesting event handler gives me the sender, which is the second combobox.  From that, how do I get the value of the first combobox?

Thanks
Sebastian
Telerik team
 answered on 27 Jun 2011
1 answer
438 views
How to display data in grid view in matrix format?
Shinu
Top achievements
Rank 2
 answered on 27 Jun 2011
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?