Current filter:
                                You should refresh the page.
                                  • Hi
                                    I have an aspxtreelist in VirtualMode.
                                    The treelist contain Templates .
                                    I want when FocusedNodeChanged occures to change the style of the node, i dont seem to affect the node template.
                                     treeList.Styles.FocusedNode.ForeColor = red
                                     How to change the template forecolor?
                                    Thx

                                Show all comments
                                • Vito (DevExpress Support) 05.21.2009

                                  Hi Limor,
                                  I'll be happy to assist you, but, unfortunately, from your post I don't quite understand how to reproduce the problem you ran into. Can you please post here a small sample, illustrating the issue in action? We'll examine it, and will look for a solution.
                                  Thanks,
                                  Vito

                                • Powercom 05.21.2009

                                  ok,
                                  How can i change node datacell color when focusing ?
                                  ( aspxtreelist virtualmode )
                                  I tried:
                                   protected void treelist_FocusedNodeChanged(object sender, EventArgs e)
                                      {
                                         Label lblNode = (Label)treeList.FindDataCellTemplateControl(treeList.FocusedNode.Key,null , "lblNode");
                                          if (lblNode != null)
                                          {
                                              lblNode.Attributes.Add("style", "color:yellow !important;");
                                           }
                                        }
                                  //////////////////////////aspx/////////////////////////
                                   protected void treelist_FocusedNodeChanged(object sender, EventArgs e)
                                      {
                                          string url = "";
                                          TreeListNode node = treeList.FocusedNode;
                                          if (node != null)
                                          {
                                              if (Int32.Parse(node.GetValue("type").ToString()) == (int)Device_Type.METER)
                                              {
                                                // url = ResolveUrl(string.Format("~/Templates/Meter/Meter.aspx?type={0}&id={1}", node.GetValue("type").ToString(), node.Key));
                                              }

                                          }
                                          //treeList.Columns["name"] as TreeListDataColumn
                                          Label lblNode = (Label)treeList.FindDataCellTemplateControl(treeList.FocusedNode.Key,null , "lblNode");
                                          if (lblNode != null)
                                          {
                                              lblNode.Attributes.Add("style", "color:yellow !important;");
                                              lblNode.Text = "asasa";
                                          }

                                      }

                                • Powercom 05.21.2009

                                  ok,
                                  How can i change node datacell color when focusing ?
                                  ( aspxtreelist virtualmode )
                                  I tried:
                                   protected void treelist_FocusedNodeChanged(object sender, EventArgs e)
                                      {
                                         Label lblNode = (Label)treeList.FindDataCellTemplateControl(treeList.FocusedNode.Key,null , "lblNode");
                                          if (lblNode != null)
                                          {
                                              lblNode.Attributes.Add("style", "color:yellow !important;");
                                           }
                                        }
                                  //////////////////////////aspx/////////////////////////
                                   protected void treelist_FocusedNodeChanged(object sender, EventArgs e)
                                      {
                                          string url = "";
                                          TreeListNode node = treeList.FocusedNode;
                                          if (node != null)
                                          {
                                              if (Int32.Parse(node.GetValue("type").ToString()) == (int)Device_Type.METER)
                                              {
                                                // url = ResolveUrl(string.Format("~/Templates/Meter/Meter.aspx?type={0}&id={1}", node.GetValue("type").ToString(), node.Key));
                                              }

                                          }
                                          //treeList.Columns["name"] as TreeListDataColumn
                                          Label lblNode = (Label)treeList.FindDataCellTemplateControl(treeList.FocusedNode.Key,null , "lblNode");
                                          if (lblNode != null)
                                          {
                                              lblNode.Attributes.Add("style", "color:yellow !important;");
                                              lblNode.Text = "asasa";
                                          }

                                      }

                                • Vito (DevExpress Support) 05.21.2009

                                  Hi Limor,
                                  If you wish to change the background color of a control located inside a column's template only when a node is focused, you should handle the ASPxTreeList's HtmlDataCellPrepared event for this purpose. Please look at the attached sample, demonstrating how to do this.
                                  Thanks,
                                  Vito

                                • Powercom 05.23.2009

                                  Thanks
                                  But it is only good for the first node.
                                  The treelist created on virtual node
                                  the event HtmlDataCellPrepared not occure for the node children

                                • Vito (DevExpress Support) 05.25.2009

                                  Hi Limor,
                                  Thank you for the response.
                                  However, I don't quite understand why you can't use this approach: it seems to work as expected when ASPxTreeList is working in "Virtual" mode. Attached is a small sample, illustrating this. Can you please let us know how we should modify it to see the problem?
                                  Thanks,
                                  Vito

                                0 Solutions

                                Creation Date Importance Sort by