Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
302 views
Hi,
I saw the demo code for exporting rad grid data in to csv files. But in my application I am not getting ExportToCSV() method. Can you tell me why I am not able to access this ExportToCSV() method. I am getting only ExportToExcel() and ExportToExcel2007(), even though i am getting ExportToExel as Obolete
Daniel
Telerik team
 answered on 11 Jun 2009
2 answers
99 views
Hi,

So far I've implemented most of the controls without much hassle, except the chart control...

Databinding overwrites pre-defined series
If a series is created in the aspx and a datasourseid is specified, the series created in aspx will not show

Find all x label values, but not series values
It defines the x label values from the complete data set, however it only displays the data for the x labels found in the first series.  So if the datatable doesn't have values for each x-point then it doesn't show.  I've checked my sql query and flipped the order by (eg. year first, month first) and depending on the order by, some bars will show and some not.  Will now write some dodge sql to ensure data at each x-point.

Formatting text x values (text color specifically)
No idea where this is set and have been searching for an hour.


Any ideas or suggestions would really be appreciated.







Vladimir Milev
Telerik team
 answered on 11 Jun 2009
2 answers
67 views
Hello,

Is there anyone who had experienced problems using a contextmenu into a radpane?

My problem is as follows:
I have an input button into a radpane and an a javascript function that shows the context menu when the button is clicked. But when the menu is displayed it collapses inmediately. I have copied the code and pasted it outside the radpane and then it works fine.
Svetlina Anati
Telerik team
 answered on 11 Jun 2009
1 answer
117 views
Hello

I am sure there must be an option for this, but I can't find it.
In the image manager I want there only to be one image selector when it first starts up rather than 3 and I don't want it to add a new one each time.
I also don't want the remove buttons.
Is there an option, similar  to the fileupload control that allows this?

Thanks

Rumen
Telerik team
 answered on 11 Jun 2009
1 answer
160 views
In my grid I have a FormTemplate and use an ImageButton for both the Update and Canel:

<asp:ImageButton ID="imgUpdate" runat="server" ImageUrl="~/images/Update.gif" ToolTip="Update Record" 
  Style="padding-right: 5px" CommandName="Update" OnClientClick="OnSessionUpdate(this)" /> 
<asp:ImageButton ID="imgCancel" runat="server" ImageUrl="~/images/Cancel.gif" ToolTip="Cancel Editing" 
  CommandName="Cancel" /> 

I want to implement my own client-side validation mechanism. When the user clicks the Update button I use the OnClientClick event to call a function where I validate various controls within the FormTemplate. If the validation determines that the user must enter some data, I want to cancel the grid calling the ItemCommand event on the server-side. I have not found any means by which I can cancel the grid from calling the ItemCommand event (or any other event for that matter).

How can I cancel the grid from doing a postback?

Thanks
Johann
Veli
Telerik team
 answered on 11 Jun 2009
1 answer
162 views
When the Telerik treeview is used and the node's ExpandMode is set to ServerSide, selecting a node causes postback to occur. The existing tree has a lot of nodes. This causes a delay when trying to select other nodes. We avoid the postback that occurs after node selection by using the OnClientNodeChecking and set_cancel(true) methods. Our problem is that when going to the server, the tree is loosing its state. In cases where expanding a node also causes postpack, we would like to know if there is a way to save the state of the treeview nodes before the postback occurs so that we can be aware of the state of the nodes on the server. (We want to use this implementation).
Shinu
Top achievements
Rank 2
 answered on 11 Jun 2009
1 answer
135 views
I have amout 25000 data items. They are grouped first by the Person after by an ID and third by another Value.
Actually it loads, but slowly! more than 10 seconds to list all. They are grouped with the grouped by expressions.

All columns are not expanded at start. So it should even load the second hierarchy when i click on a first hierarchy item one.

Whats best quickest way for that?

Thanks.
Veli
Telerik team
 answered on 11 Jun 2009
7 answers
209 views
I found the article by Kevin Babcock on the blogsite, but the c# zip file seems to be corrupt.  anybody know where I can find the code for this.

Thanks


Sonya
Telerik team
 answered on 11 Jun 2009
3 answers
260 views

Hi, I have created a user control of RadComboBox with Checkboxes. It has Select All checkbox as HeaderTemplate. All selected values are displayed in the textbox of RadComboBox. It works fine for single instance of user control.

But when I add multiple controls in a page, any checkbox click event refers to last user control added. i.e. Select All, or any checkbox click event refers to last created dropdown. Any help is appreciated.

Here is the code of my user control DropdownControl.ascx

 

<

script type="text/javascript">  

 

 

 

var cancelDropDownClosing = false;  

 

function StopPropagation(e)

 {

 

    //cancel bubbling

 

 

 

   e.cancelBubble = true;

 

 

 

    if (e.stopPropagation)

 

 

     {

        e.stopPropagation();

    }

}

 


function
onDropDownClosing()

 

 

{

    cancelDropDownClosing =

false;

 

 

}

 

function onCheckBoxClick(chk)

 

 

{

 

    var combo = $find("<%= RadComboBox1.ClientID %>");

 

    //if any item is selected, uncheck select all

 

 

 

    if (AllSelected() == true)    

 

 

     {

 

        var chkall = $get(combo.get_id() + "_Header_SelectAll");

 

 

         chkall.checked =

true;

 

 

    }

 

    else

 

 

 

    {

 

 

 

        var chkall = $get(combo.get_id() + "_Header_SelectAll");

 

 

         chkall.checked =

false;

 

 

     }

 

//holds the text of all checked items

 

 

 

 var text = "";

 

 

 

//holds the values of all checked items

 

 

 

 var values = "";

 

 

 

 

//get the collection of all items

 

 

var items = combo.get_items();

 

 

 

 

//enumerate all items

 

 

 

for (var i = 0; i < items.get_count(); i++)

 

 {

 

var item = items.getItem(i);

 

 

 

//get the checkbox element of the current item

 

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

 

if (chk1.checked)

 

 

 {

text += item.get_text() +

"," ;

 

 

 values += item.get_value() +

",";

 

 

 }

}

 

 

//remove the last comma from the string 

 

text = removeLastComma(text);

 

 values = removeLastComma(values);

 

if (text.length > 0)

 

 

 {

 

//set the text of the combobox

 

 

 

combo.set_text(text);

 

 

}

 

else

 

 

 

{

 

 

 

//all checkboxes are unchecked

 

 

 

//so reset the controls

 

 

 

combo.set_text("");

 

 

 }

}

 

 

//this method removes the ending comma from a string

 

 

 

function removeLastComma(str)

 

 

 {

 

    return str.replace(/,$/,"");

 

 

 }
 

 

//Check if any one value is selected in drop down 

 

function AnyOneSelected()

 

 

{

 

var combo = $find("<%=RadComboBox1.ClientID %>");

 

 

 

var items = combo.get_items();

 

 

 

 

for(var i = 0; i < items.get_count(); i++)

 {

 

var item = items.getItem(i);

 

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

 

if (chk1.checked)

 

 

{

 

return true;

 

 

 }

 }

 

return false;

 

 

 }

 

 

//Check if all the values are selected in drop down

 

 

 

 

 

function AllSelected()

 

 

{

 

var combo = $find("<%=RadComboBox1.ClientID %>");

 

 

 

 

var items = combo.get_items();

 

 

 

for(var i = 0; i < items.get_count(); i++)

 

{

 

var item = items.getItem(i);

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

 

if (chk1.checked == false)

 

{

 

return false;

 

 

 }

 }

 

return true;

 

 

 }

 

 

//Handle Select All click

 

 

 

function selectAllClick(chk)

 

 

 {

 

//if selectAll = true; check All ; otherwise uncheck all

 

 

 

var selectAll = true;

 

 

 

if (AnyOneSelected() == true)

 

 

 selectAll =

true;

 

 

 

 

if (AllSelected() == true)

 

 

 selectAll =

false;

 

 

 

 

//holds the text of all checked items

 

 

 

var text = "";

 

 

 

//holds the values of all checked items

 

 

 

var values = "";

 

 

 

var combo = $find("<%=RadComboBox1.ClientID %>");

 

 

 

var items = combo.get_items();

 

for(var i = 0; i < items.get_count(); i++)

 {

 

var item = items.getItem(i);

 

 

var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");

 

 

if (selectAll)

 

 chk1.checked =

true;

 

 

else

 

 

chk1.checked = false;

 

 

if (chk1.checked)

 

{

text += item.get_text() +

"," ;

 

 values += item.get_value() +

",";

 

 }

 }

 

 

//remove the last comma from the string

 

text = removeLastComma(text);

values = removeLastComma(values);

 

if (text.length > 0)

 

//set the text of the combobox

 

combo.set_text(text);

 

else

 

 

//all checkboxes are unchecked

 

 

//so reset the controls
combo.set_text("");

 

 }

 

 

</

script>

 

 <

div>

 

 

<table>

 

 

<tr>

 

 

<td style="height: 43px">

 

 

<telerik:RadComboBox ID="RadComboBox1" runat="server" Skin="Vista" AllowCustomText="true"

 

 

HighlightTemplatedItems="false" OnClientDropDownClosed="onDropDownClosing">

 

 

<HeaderTemplate>

 

 

<asp:CheckBox runat="server" ID="SelectAll" onclick="selectAllClick(this)" />

 

 

<asp:Label runat="server" ID="hdrLabel" AssociatedControlID="SelectAll">Select All</asp:Label>

 

 

</HeaderTemplate>

 

 

<ItemTemplate>

 

 

<div onclick="StopPropagation(event)" class="combo-item-template">

 

 

<asp:CheckBox runat="server" ID="chk1" onclick="onCheckBoxClick(this)" />

 

 

<asp:Label runat="server" ID="label1" AssociatedControlID="chk1"><%# DataBinder.Eval(Container, "Text") %></asp:Label>

 

 

</div>

 

 

</ItemTemplate>

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 </

div>

 

 

 

The properties are implemented just to bind dropdown to stored procedure. The Select All and everything works fine if I add only one control. But if I add another control dd2, all click events in dd1 refers to dd2.


Web.Reporting.WebCommon.Controls.
DropdownControl dd1 = (Web.Reporting.WebCommon.Controls.DropdownControl) LoadControl("~/WebCommon/Controls/DropdownControl.ascx");

 dd1.cs =

ConfigurationManager.ConnectionStrings["CS"].ToString();

 

 dd1.DataSourceProcedureName =

"uspGetPortfolioAssetType";

 

 dd1.DataTextField =

"portfolioAssetType";

 

 dd1.DataValueField =

"portfolioAssetTypeId";

 

 

 

Web.Reporting.WebCommon.Controls.DropdownControl dd2 = (Web.Reporting.WebCommon.Controls.DropdownControl) LoadControl("~/WebCommon/Controls/DropdownControl.ascx");

 

 dd2.cs =

ConfigurationManager.ConnectionStrings["CS"].ToString();

 

 dd2.DataSourceProcedureName =

"uspGetAssetClass";

 

 dd2.DataTextField =

"assetClassDescription";

 

 dd2.DataValueField =

"assetClassId";

 

 

 

 

 

 

 

           

Veselin Vasilev
Telerik team
 answered on 11 Jun 2009
1 answer
214 views
Hi,

I have a RadGrid with a NestedViewTemplate in a DetailTable in a DetailTable.
So the grid (without columns etc) looks like this :
<telerik:RadGrid ID="customerRadGrid">  
    <MasterTableView DataKeyNames="CustomerID">  
      <DetailTables> 
         <telerik:GridTableView DataKeyNames="ProductID">  
            <ParentTableRelation> 
              <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" /> 
            </ParentTableRelation> 
            <DetailTables>   
              <telerik:GridTableView DataKeyNames="SupplierID">  
                <ParentTableRelation> 
                  <telerik:GridRelationFields DetailKeyField="ProductID" MasterKeyField="ProductID" /> 
                </ParentTableRelation> 
                <NestedViewTemplate> 
                      <asp:Button ID="startButton" runat="server" Text="Start"   
                        onclick="startButton_Click" />                    
                </NestedViewTemplate> 
              </telerik:GridTableView>                
            </DetailTables> 
         </telerik:GridTableView> 
      </DetailTables> 
    </MasterTableView> 
  </telerik:RadGrid> 


In the template there is a button for the user to click.
When the user clicks the button i need to know what the parent row is, so i can get the datakeyvalue of that row.

I tried this by setting the row to selected as soon as the user expands it but since there can be multiple rows expanded this isn't working.

Anybody any ideas?
Princy
Top achievements
Rank 2
 answered on 11 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?