//Find : finds all occurrences by making R call once. And then selects the grid cell for the first search result
        private void gridfindbutton_Click(object sender, RoutedEventArgs e)
        {
            BSkyMouseBusyHandler.ShowMouseBusy();
            gridfindbutton.IsEnabled = false;
            if (searchModified) //if text was changed (search modified) then run find and make R call
            {
                string findtext         = searchtext.Text;
                bool   matchcase        = (matchcasecheckbox.IsChecked == true) ? true : false;
                int    selectedcolcount = selectedColslistbox.SelectedItems.Count;
                //List<DataSourceVariable> selcolnames = selectedColslistbox.SelectedItems as List<DataSourceVariable>;
                string[] selcolumnnames = new string[selectedcolcount];
                int      i = 0;
                foreach (DataSourceVariable dsv in selectedColslistbox.SelectedItems)
                {
                    selcolumnnames[i] = dsv.RName;
                    i++;
                }
                dp.FindGridText(findtext, selcolumnnames, matchcase);

                searchModified = false;//now until someone types new string or modifies, we will not make R calls. We will do NEXT.

                //Also very first time try to jump to the first match.
                dp.FindNextGridText();
            }
            else // No need to make R call. Rather just loop through the results unless the search is modified.
            {
                dp.FindNextGridText();
            }
            gridfindbutton.IsEnabled = true;
            BSkyMouseBusyHandler.HideMouseBusy();
        }