Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:57:57+00:00 2026-06-10T01:57:57+00:00

I am trying to create a rule screen where user can specify different rules,

  • 0

I am trying to create a rule screen where user can specify different rules, save them & later on apply on data. User can also group the rules for AND OR condition. My query is if this is the right way to do it & when user clicks on remove that row should be removed, I am not sure how to do that?

Following is my XAML :

<Grid x:Name="LayoutRoot" Background="White" Width="600" Height="200" ShowGridLines="True">
    <Grid.RowDefinitions><RowDefinition Height="30" /></Grid.RowDefinitions>
    <Grid.ColumnDefinitions><ColumnDefinition Width="135"/><ColumnDefinition Width="25"/><ColumnDefinition Width="135"/><ColumnDefinition Width="135"/>
        <ColumnDefinition Width="135"/><ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <telerik:RadComboBox Name="Header" Grid.Row="0" Width="100" HorizontalAlignment="Left">
            <telerik:RadComboBoxItem Content="And" IsSelected="True"></telerik:RadComboBoxItem>
            <telerik:RadComboBoxItem Content="Or"></telerik:RadComboBoxItem>
        </telerik:RadComboBox>
    <telerik:RadButton Content="+" Height="31" HorizontalAlignment="Left" Margin="106,0,0,0" Name="btnAdd" VerticalAlignment="Top" Width="26" Click="btnAdd_Click" />
</Grid>

And code behind is:

   private void btnAdd_Click(object sender, RoutedEventArgs e)
    {
        var row = new RowDefinition();

        row.Height = new GridLength(30);
        LayoutRoot.RowDefinitions.Add(row);

        var columnCombo = new Telerik.Windows.Controls.RadComboBox() { Width = 100, Height = 30, HorizontalAlignment = HorizontalAlignment.Left };
        columnCombo.Items.Add("Column1");
        columnCombo.Items.Add("Column2");
        columnCombo.Items.Add("Column3");

        var operatorCombo = new Telerik.Windows.Controls.RadComboBox() { Width = 100, Height = 30, HorizontalAlignment = HorizontalAlignment.Left};
        operatorCombo.Items.Add("contains");
        operatorCombo.Items.Add("startsWith");
        operatorCombo.Items.Add("endsWith");

        var btnRemove = new Telerik.Windows.Controls.RadButton() { Width = 20, Height = 30, Content = "X" };
        btnRemove.Click += new RoutedEventHandler(btnRemove_Click);

        var btnGroup = new Telerik.Windows.Controls.RadButton() { Content = "Group", Width = 50, Height = 30 };
        btnGroup.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
        btnGroup.Click += new RoutedEventHandler(btnGroup_Click);

        var calendar = new Telerik.Windows.Controls.RadDatePicker();

        LayoutRoot.Children.Add(btnRemove);
        LayoutRoot.Children.Add(btnGroup);
        LayoutRoot.Children.Add(columnCombo);
        LayoutRoot.Children.Add(operatorCombo);
        LayoutRoot.Children.Add(calendar);

        int newrow = LayoutRoot.RowDefinitions.Count-1;

        Grid.SetRow(btnRemove, newrow);
        Grid.SetColumn(btnRemove, 1);
        Grid.SetRow(columnCombo, newrow);
        Grid.SetColumn(columnCombo, 2);
        Grid.SetRow(operatorCombo, newrow);
        Grid.SetColumn(operatorCombo, 3);
        Grid.SetRow(calendar, newrow);
        Grid.SetColumn(calendar, 4);
        Grid.SetRow(btnGroup, newrow);
        Grid.SetColumn(btnGroup, 5);

    }

    public void btnGroup_Click(object sender, RoutedEventArgs e)
    {
        throw new NotImplementedException();
    }

    public void btnRemove_Click(object sender, RoutedEventArgs e)
    {

        //TODO: Here I want to find out from which Gridrow user has clicked & remove that grid row & controls inside it.
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:57:59+00:00Added an answer on June 10, 2026 at 1:57 am

    You could use the Tag property of each button to get the row you want to delete.

    http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.tag(v=vs.95).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a rewrite rule to match data-2, data-3, data-4 etc. and
I am trying to create a rule for snort to basically log any packets
I'm trying to create an conditional Rewrite Rule using an .htaccess file and Apache.
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create a macro which can be used for print debug messages when
Using PyClips, I'm trying to build rules in Clips that dynamically retrieve data from
im into SEO and friendly URL's and im trying to create a rule in
I am trying to create a rewrite rule which will detect numbers only and
I'm trying to create a rewrite rule that will do the following: http://www.example.com/http://other.example.com →
I'm trying to create a custom delete rule on a relationship between a parent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.