Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views
Hi All,

I need to access the current value of a Server Side variable (stored as a ViewState var) from a Java Script.
easy enough...eg

 

 

var i == <%= OGridItem_ItemIndex %>

but, If I set the value in Server code, and on Client Side try to Access it, I get it's previous (initial value) , not it's new current value??
 I have RadAjax Manager and grid on page and all ajaxified ControlId's and UpdatedControls in it. And that Server set Viewstate Var is not nor seems to be able to be.
Script and Grid are wrapped in RadCodeBlocks.

If I try it a few times, it always returns the Previous not current value.
The current Value is set in C#  after a straightforward    __DoPOstback(Arg_Source, EventArgs). The rest of the Controls on the page are set for Ajax postbacks as per the RadAjaxManager.

How do I retrieve the current value of this ViewState Var when in JS??

Thx
Neal

 

Veli
Telerik team
 answered on 19 Aug 2010
1 answer
219 views
Hi guys,
I am very new to Telerik Products. I am having few issues with adding images dynamically to treeview nodes .Do you guys know any example which I can refer? Thanks.
Shinu
Top achievements
Rank 2
 answered on 19 Aug 2010
4 answers
163 views
My requirement is that if a parent node is checked, all the children must be checked. We like the tristate checkbox functionality. So, what we'd like is when the parent is checked, the childnodes are disabled so that they may not be unchecked. This causes a problem with expanding and collapsing, but I've seen that there is a workaround for that. My problem comes with unchecking the parent. It unchecks and then comes right back again. There is also a problem with enabling nodes again once disabled, i.e. if the node is being unchecked due to CheckChildNodes property, the NodeCheck event is not fired and it never gets enabled again.
      
              <telerik:RadTreeView ID="rtvVendor" runat="server" CheckBoxes="True"CheckChildNodes="True" 
                            Skin="Outlook" TriStateCheckBoxes="true" Width="500px"Height="400px" BorderStyle="Solid"
                            BorderColor="#4888A2" BorderWidth="1px"
                            OnNodeCheck="rtvVendor_NodeCheck"
                            ><%-- OnNodeDataBound="rtvVendor_NodeDataBound">--%>
                        </telerik:RadTreeView>

    #region TreeVendor
        private void BindToDataTable(RadTreeView treeView)
        {
            char[] separator = new char[] { ':' };
            string[] strSplitArr = rcbAssociate.SelectedValue.Split(separator);
            string FullAssocID = strSplitArr[0];
  
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SpecialistMappingConnectionString"].ConnectionString);
            SqlCommand sqlCmd = new SqlCommand("uspSpecialistMapping_LoadFOBTree3", connection);
            SqlDataAdapter adapter = new SqlDataAdapter();
            sqlCmd.CommandType = CommandType.StoredProcedure;
  
            sqlCmd.Parameters.AddWithValue("@FullAssocID", FullAssocID);
            sqlCmd.Parameters.AddWithValue("@PDiv", rcbPDiv.SelectedValue);
  
            DataTable dataTable = new DataTable();
            adapter.SelectCommand = sqlCmd;
            adapter.Fill(dataTable);
  
            //Added by RB 5/24/2010 
            RadTreeNodeBinding binding = new RadTreeNodeBinding();
            binding.CheckedField = "IsChecked";
            treeView.DataBindings.Add(binding);
  
            binding = new RadTreeNodeBinding();
            binding.ExpandedField = "IsChecked";
            treeView.DataBindings.Add(binding);
  
            treeView.DataTextField = "FOBName";
            treeView.DataFieldID = "FOBID";
            treeView.DataValueField = "FOBID";
            treeView.DataFieldParentID = "ParentID";
            treeView.DataSource = dataTable;
            treeView.DataBind();
        }
  
  
    #endregion
  
  
    #region SaveValues
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!rcbPDiv.SelectedValue.Equals("") && !rcbAssociate.SelectedValue.Equals(""))
            {
                char[] separator = new char[] { ':' };
                string[] strSplitArr = rcbAssociate.SelectedValue.Split(separator);
                string FullAssocID = strSplitArr[0];
  
                //Delete old cheched Vendors.
                using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SpecialistMappingConnectionString"].ConnectionString))
                {
                    SqlCommand sqlCmd = new SqlCommand("uspSpecialistMapping_DeleteVendor", connection);
  
                    sqlCmd.CommandType = CommandType.StoredProcedure;
                    sqlCmd.Parameters.AddWithValue("@FullAssocID", FullAssocID);
                    sqlCmd.Parameters.AddWithValue("@PDiv", rcbPDiv.SelectedValue);
                    try
                    {
                        connection.Open();
                        sqlCmd.ExecuteNonQuery();
                    }
                    catch (SqlException sqlEx)
                    {
                        throw;
                    }
                }
  
                ShowCheckedNodes(rtvVendor, nodesClientside, FullAssocID);
  
            }
        }
  
        private void ShowCheckedNodes(RadTreeView treeView, Label label, string FullAssocID)
        {
            string message = string.Empty;
            int count = 0;
            IList<RadTreeNode> nodeCollection = treeView.CheckedNodes;
            foreach (RadTreeNode node in nodeCollection)
            {
                if (node.CheckState.ToString().Equals("Checked"))
                {
                    string tmp = node.Value;
                    if (tmp.IndexOf("3", 0, 1) != -1)
                    {
                        string strDeptID = tmp.Substring(1, 4);
                        string strVendorID = tmp.Substring(5, 4);
  
                        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SpecialistMappingConnectionString"].ConnectionString))
                        {
                            SqlCommand sqlCmd = new SqlCommand("uspSpecialistMapping_InsertVendor", connection);
  
                            sqlCmd.CommandType = CommandType.StoredProcedure;
                            sqlCmd.Parameters.AddWithValue("@FullAssocID", FullAssocID);
                            sqlCmd.Parameters.AddWithValue("@Dept", strDeptID);
                            sqlCmd.Parameters.AddWithValue("@Vendor", strVendorID);
                            try
                            {
                                connection.Open();
                                count += sqlCmd.ExecuteNonQuery();
                            }
                            catch (SqlException sqlEx)
                            {
                                throw;
                            }
                        }
  
                        message += node.Value + "[" + node.FullPath + "]" + "<br/>";
                    }
                }
            }
            if (count > 0)
            {
                string script = "alert('Changes saved successfully!')";
                RadScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), script, true);
            }
        }
    #endregion
  
      
    protected void rtvVendor_NodeCheck(object sender, RadTreeNodeEventArgs e)
    {
        rtvVendor.TriStateCheckBoxes = false;
  
        if (e.Node.Checked)
            e.Node.CheckChildNodes();
        else
            e.Node.UncheckChildNodes();
        for (int i = 0; i < e.Node.Nodes.Count; i++)
            e.Node.Nodes[i].Enabled = !e.Node.Checked;
        rtvVendor.TriStateCheckBoxes = true;
    }
  
  
  
  

Nikolay Tsenkov
Telerik team
 answered on 19 Aug 2010
1 answer
91 views
I'm using RadControls for ASP.NET AJAX Q2 2009 SP1. I try to use javascript to call some funtion in RadEditor. But some funtion not work.Here my code
<script language="javascript" type="text/javascript">
    function Execute(command, args) {
        var o = new Object();
        o.get_value = function() { return args; }
        o.get_commandName = function() { return command; }
        $find("txtText").fire(command, o);
        alert(args);
    }
</script>
                    <select size="1" name="cboFont"  onchange="return Execute('FontName',this.value)" >
                        <option value="Arial">Arial</option>
                        <option value="Time New Roman">Time New Roman</option>
                    </select>
                    <select size="1" name="cboSize" onchange="return Execute('RealFontSize',this.value)">
                        <option value="15">15</option>
                        <option value="18">18</option>
                        <option value="20">20</option>
                    </select>
RealFontSize command work but FontName command not work. Please help me. Thank!
Rumen
Telerik team
 answered on 19 Aug 2010
1 answer
76 views

Hello

I am using MultiDayView to show 8 days interval. It works well for appointments that start and end in a single day, but if I am trying to increase appointment's end using mouse so that it should go to a next day's - the scheduler does not allow me to do that.

In fact, I can make such multiple days appointments, but only using the advanced form to set the end date manually.

Questions:

1) How to allow proper resizing that covers several days?

2) How to make an appointment to be displayed as "solid" block ? I mean like an ordinary appointment and not splitted up on pieces with arrows (look at the attached example)

2.1) An additional problem with that "splitted up" appointment is that when I want to drag it to other place, it drags only a part of that appointment. Very confusing...

I hope you understand my problem

Peter
Telerik team
 answered on 19 Aug 2010
1 answer
160 views
Is there a way to have scrolling for GridTableView?

I have a grid that has a details sectionand the content of the details is much more then the MasterTableView and it would be great if the  when the details is expended the width of the details wasn't larger than the grid and just have scrolling available.

At the moment the content simply is whatever the width is and you have to scroll the page to see the content.

Thanks
Dimo
Telerik team
 answered on 19 Aug 2010
1 answer
101 views
I am building a site with a radGrid that has a popup edit form in a radWindow.  When the window closes its supposed to ajax reload the parent grid.  We implemented this using the examples from the demo area of this site, however, we are now getting this error:

Error: uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIDOMJSWindow.setTimeout]"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame :: http://localhost:3650/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3a7302be66-e7a1-4bc1-8280-71f03d66eba0%3a16e4e7cd%3af7645509%3a22a6274a%3a86526ba7%3a874f8ea2%3ab7778d6c%3a24ee1bba%3a1e771326%3aaa288e2d%3a8674cba1%3ac08e9f8a%3a59462f1%3aa51ee93e%3ae085fe68 :: anonymous :: line 6"  data: no]

We have several pages that need to operate this way, but I need help discerning what this error is about.  Thank you.
Fiko
Telerik team
 answered on 19 Aug 2010
1 answer
298 views
Hi all,

I am currently building a gannt chart, which is currently reading data from a database called title to place into the 'datalabels' column. This works, however rather than showing the labels on the graph I want to show them when the user hovers over the data item. How can this be achieved?

regards,

Ash
Ves
Telerik team
 answered on 19 Aug 2010
3 answers
316 views
Hi

Is it possible to bind the radrotator to a image libraray we have created in sitefinity.  How do you set the datasource property within sitefinty to point to the library.

Any help would be greatly appreciated.
Georgi
Telerik team
 answered on 19 Aug 2010
1 answer
166 views
We have an aspx page that has two RadGrids and a Rad Panel.  The RadGrids contain lists of users which can be moved back and forth by double clicking.  The Rad Panel contains information about the users.  This information is populated using the OnSelectedIndexChanged event.  In order to get the user information to display and update in the panel, the EnablePostBackOnRowClick event is set to true.  The information in the panel is always updated correctly; however, the users in the grids do not always move when they are double clicked.

It looks like the Post Back is occurring before the double click.  If we remove the EnablePostBackOnRowClick and remove the OnSelectedIndexChanged events, the users move every time they are double clicked... however the information at the bottom has been removed.  This was working until recently as implemented.  Is it possible this was changed in a patch?  If not, how can I implement this so the users are always moved when they are double clicked?
Shinu
Top achievements
Rank 2
 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?