BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Dirk,
Thanks for using Syncfusion products.
We would like to let you know that your requirement has been achieved by using Button OnClick Event. Please refer the below code snippets.
[ASPX]
…
<asp:Button runat="server" ID="btn" Text="click here" OnClick="Button_Click"/>
…
[CS]
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetData();
}
this.GridgroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended; // For Select Multiple rows.
}
…
public void Button_Click(object sender, EventArgs e)
{
//Button Click fired to Here.
}
…
For your convenience we have created simple sample with your requirement and the same can be downloaded from the following link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/118077/WebApplication1-1856261089.zip
Please let us know if you need further assistance.
Regards,
Shanmugaraja K
Hi Dirk,
Thanks for your update.
We would like to let you know that your requirement has been achieved by handling Button OnClick and OnClientClick Events. Please refer the below code snippets.
[JS]
function clickhere()
{
var obj = document.getElementById('<%= hidden.ClientID %>')
obj.value = $find("MainContent_GridgroupingControl1").get_SelectionManager().selectedRowsCollection; // store the selected records index in the hidden field.
}
[ASPX]
…
<asp:HiddenField runat="server" ID="hidden"/>
<asp:Button runat="server" ID="btn" Text="click here" OnClick="Button_Click" OnClientClick="clickhere()"/>
…
[CS]
public void Button_Click(object sender, EventArgs e)
{
var array = hidden.Value.Split(','); // can get the hidden field values (selected Records index) here.
int[] records = array.Select(x => int.Parse(x)).ToArray();
var selectedrecords = this.GridgroupingControl1.Table.Records[records[0]];//Get the selected Records here.
//Button Click fired to Here
}
For your convenience we have modified the sample and the same can be downloaded from the following link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/118077/WebApplication1_(2)-501109235.zip
Please let us know if you need further assistance.
Regards,
Hi Dirk,
Thanks for your update.
Query 1: get_Selectionmanager Function Issue.
We have analysed your attached sample and you have used Grid Element for get selectionmanager, we suggest you to use gridObj to get the SelectionManager. Please refer the below code snippets.
[JS]
function clickhere() {
var obj = document.getElementById('<%= hidden.ClientID %>')
var gridid = document.getElementById('<%= Grid.ClientID %>').id;
obj.value = $find(gridid).get_SelectionManager().selectedRowsCollection;
}
Query 2: Multi selection not working in ajax mode.
We are sorry about the inconvenience caused. We are unable to reproduce the issue in our end. We have attached video demonstration of the working of your sample and the same can be downloaded from the following link.
Video link: http://www.syncfusion.com/downloads/support/directtrac/118077/multirows1950143741.zip
Sample link: http://www.syncfusion.com/downloads/support/directtrac/118077/WebApplication11827500598.zip
Please try the above sample and get back to us if, you are able to reproduce the issue. If not, could you please give more information about the multi selection issue. Please provide issue replicated video or more code snippets with us. The information provided would be a great help by resolving the issue.
Please let us know if you need further assistance
Regards,
Shanmugaraja K
Hi Dirk,
Thanks for your update.
We are glad to know that your issue has been resolved. Please let us know if you have any other concerns so that we will be happy to help you out.
Regards,
Shanmugaraja K