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

  • Home
  • SEARCH
  • 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 7595001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:33:43+00:00 2026-05-30T21:33:43+00:00

I have a radgrid, for date column i have created a custom user control

  • 0

I have a radgrid, for date column i have created a custom user control for filtering. I need to create a close button to close the user control. There are no close events which i can call. I don’t want to make visibility collapsed. I started with something below:

public partial class DateFilterControl : UserControl, IFilteringControl
{
    public event CloseEventHandler Close;
    public delegate void CloseEventHandler();

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        this.Close();            
    }
}

It is throwing nullreference exception which is obvious to come. What code do i need to put to close the user control?

  • 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-05-30T21:33:44+00:00Added an answer on May 30, 2026 at 9:33 pm

    use Messaging Service. With this you can close the window in ViewModel so no need to give close function in Backend. Add Command property to Cancel button

     <Button Content="Cancel" Command="{Binding CancelCommand}"/>
    

    Now in the ViewModel add the RelayCommand property in that add

     Messenger.Default.Send<bool>(true, typeof(XViewModel));
    

    Now in the BackEnd of this userControl adds following in the constructor.

     Messenger.Default.Register<bool>(this, typeof(ScheduleViewModel), (b) => 
                                            {
                                                if (b == true)
                                                {
                                                    this.DialogResult = true;
                                                }
                                            });
    

    Now u can close the Window…
    This will surely helps u…

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

Sidebar

Related Questions

I'm trying to add a custom filter to my RadGrid. I have a column,
I have a RadGrid from Telerik with a GridClientSelectColumn column. When the user checks
I have created a RadGrid control dynamically on Page_PreInit event and added it to
I have Telerik RadGrid with a custom edit form. In my edit form there
I have a RadGrid control with template edit form implementation. I need to have
I have added a RadControl, RadGrid and I need to add a radComboBox in
I have a radgrid controlling access to an application for users. There are two
I have a RadGrid with a custom edit form ( FormTemplate ). The grid
I have a radGrid on the page with the Add New Record button. When
I have a RadGrid which is DataBound to a IDictionary<string,string> where there are 2

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.