Author Topic: How to select the whole column by colIndx ?  (Read 1037 times)

zhouqi

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 16
    • View Profile
How to select the whole column by colIndx ?
« on: July 15, 2021, 06:55:42 pm »
Hello,

I want to set the whole column selection state by colIndx.

I use 
Code: [Select]
grid.setSelection({colIndx: 1})   function to select the column, but it occur error, it must has rowIndx property.

When I use 
Code: [Select]
grid.setSelection({rowIndx: 0, colIndx: 1}) function, it only select the body data cell[0,1]  not the whole column.

How to select the whole column by colIndx ?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How to select the whole column by colIndx ?
« Reply #1 on: July 15, 2021, 09:29:38 pm »
Documentation of setSelection says "Selects a row or cell depending upon the parameters."

Please use Range object to select a column.

Code: [Select]
grid.Range({c1: 1}).select();

https://paramquery.com/pro/api#method-Range

zhouqi

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: How to select the whole column by colIndx ?
« Reply #2 on: July 16, 2021, 06:29:10 am »
Thanks,  it's ok  :)